What happens if you break your fast in Ramadan, intentionally or unintentionally?
Let's start with "unintentionally" first. There is a hadith of the Prophet, peace be upon him, in which he says that Allah has forgiven this ummah, meaning the followers of the Prophet, peace be upon him, for that which is done out of forgetfulness, by mistake, or under duress.
Forgetfulness and mistakes come close together. Let's say forgetfulness - especially within the first few days of Ramadan when you might still feel like you're in the eating mood - you forget that you're fasting, and out of habit, you happen to eat or drink something. That doesn't actually break your fast. We know this from a hadith that says that it is Allah who has given the person the food or drinks. So, you can enjoy that. Of course, you have to stop yourself, because here somebody might feel like they have an out. You may think that based on that hadith, you fast isn't broken and you should enjoy your food and eat to your fill.
However, this only applies up to the point that you realize that you have made a mistake. Then you'd have to stop, otherwise you would be deliberately eating or drinking while you should be fasting, and that will break the fast.
Then what about by mistake? Sometimes people make a mistake in that they think it's already sunset and it's time to break the fast. So, they deliberately eat or drink something and then they realize it's not sunset yet! What happens for these few minutes of difference? Due to these few minutes of difference, some Muslim scholars might say your fast is broken because you deliberately ate or drank when it was not the time. However, I don't think we need to be so strict about it, because the Quran says, “We have not revealed the Quran to you so that you should be miserable.” Certainly, the person would feel awful, especially after fasting the whole day.
We shouldn't quarrel about these few minutes, especially since in the time of the Prophet, peace upon him, people did not have clocks. They went by simple observations and it's easy to make a mistake in observing whether it is really sunset or not. All of this is forgiven in my humble judgment, and Allah (SWT) knows best. What if it's done deliberately?
Three things break the fast: eating, drinking, or having intimate relations.
If one breaks the fast by having intimate relations during the day, then this calls for compensation. It's called “kafara” in Arabic and the kaffara is inferred from a narrative. The narrative says that a man came to the Prophet, peace be upon him, and he said, “I broke my fast, what should I do?” He had broken his fast because he had relations with his wife. The Prophet asked him, “Are you able to free a slave?” The man said no. The Prophet asked him, “Are you able to fast 60 days in a row?” The man said no. The prophet asked him, "Can you feed 60 people?” He said, “No, because I don’t have the wealth to do that.” From this, people infer that this is the sequence - this is the actual penalty. Though the Prophet, peace be upon him, is not on record for having said that this is the actual penalty. He's simply having a conversation with the man.
At that point the Prophet, peace be upon him, said to the man, "Okay, wait". Eventually, someone brought some dates to the prophet as a gift. The Prophet, peace be upon him, then gave it to the man and said, "Okay, go feed the people with this". The man said, "but Messenger of God, I don't know of anyone who would be poorer than me and my family". The Prophet laughed and said, "Okay, take it and feed your family with it". You can see the leniency of the Prophet, peace be upon him, with this man. People derived the strict ruling that if you happen to break your fast, then there's a penalty of 60 days in a row. However, let's say that's the penalty for breaking your fast. One can see a difference between breaking the fast by that means and breaking the fast by eating or drinking. In terms of eating or drinking, one might say, somebody might be driven by acute hunger or thirst to break the fast, but certainly one has no need to break the fast by other means since you can certainly wait till nightfall. You're not going to die during the day for lack of intimacy. Yet, you will find that some scholars will say that even if you're drinking by breaking the fast, you deserve the same penalty for your fasting: 60 days in a row. However, most scholars that I know will say that by eating or drinking, breaking your fast by that means is not going to require that penalty. You should just make up the day by fasting all over again after Ramadan is over.