The last stage of a Dota game has by far the most teamwork, the most organization and the most team fighting, which means fighting 5 heroes versus 5 heroes. Where these fights happen changes due to a few factors, but generally the last fight involves destroying the enemy throne.
The easiest way to throne an enemy (though not required) is to first 'Rax' them, or kill at least 1 set of barracks. Each lane has a melee and ranged barracks. When you destroy an enemy barracks it actually makes YOUR creeps in that lane stronger. If you destroyed the melee Rax, your melee creeps are stronger. If you destroy the ranged, your ranged creeps in that lane get stronger. The upgraded creeps get more damage, more hp, and they give less gold and exp, which over the course of the game disadvantages your opponents' income. It also constantly pushes in that lane towards the enemy base since the lane equilibrium is messed up.
Before we talked how lane equilibrium was something you wanted to keep neutral, but in the late game pushing is the better strategy. That's because it leads to a conflict of interest for the enemy team. If you have been Raxed, and you want to leave the base, you have to first make sure that the creep wave is pushed far out of your base because otherwise the strong enemy creeps will enter your base and do more damage to your structures, eventually leading to getting throned.
All of this pressure that Raxing your opponents creates makes it easier to Rax a second time on a different lane, and once you have 2-Raxed your opponents, the victory is almost completely assured because it becomes far too hard for your opponents to defend due to the lanes always pushing in. Once you get all 3 Raxes, you have a 99% assured victory, as your creeps get a final huge upgrade and become almost unbeatable. I have played Dota close to 10,000 games, and I've only won against a triple rax less than 20 times. It is possible to come back from that kind of a disadvantage, but it has to be late game, and you have to have the right heroes for it, so do your best to Rax your opponents, and don't get Raxed yourself.
It's clear that Raxing is the best way to win the game, but the important part is that you do it safely. To approach up the hill into the enemy's tier-3 towers and barracks requires you to go uphill where you can't see, and you'll be standing in a clumped up group which makes your opponents' aoe spells much more effective, as they'll hit more of your heroes.
When attempting to rax there is often a team fight there, which leads to chasing their heroes back to fountain, which can mean overextending, or getting too far into dangerous territory. If you overextend deep into their base and then feed your lives away, the push is usually stopped. If you push high ground and FEED your lives without taking the barracks, you are throwing the game away.
'Throwing' means that you had an advantage and you should have taken an objective, but you did something stupid and lost your chance to do it then. You threw ownership of the win to your opponents. Don't be stupid. Take the barracks and get out of their base immediately afterward. If you don't have a lot of time, just take 1 barracks, preferably the melee barracks, since it makes your creeps much stronger than the ranged barracks.
Everything I just told you about Raxing left out one important part and that's that Raxing is easiest when your opponents are dead, which means you have to kill them.
To kill the enemy heroes, you need to have to be stronger than them. Strength in Dota can be outlined in 4 generic ways, some of which I've talked about already. Gold advantage which leads to item advantages, Exp advantage which leads to more stats and more skill points (so more damage and utility), tactical advantage like fighting by your barracks where your towers are, and finally the advantage of outplaying your opponents.
The possibility to outplay your opponents is what swings games in many different ways and ALWAYS allows you to win fights even if you have less gold and exp. One of your allies might completely screw up his ultimate which makes your team fight weaker than it should have been. Perhaps one of your important heroes might get bursted down at the start of the fight, without even using his spells. Maybe your enemies got a little too lucky with their crits and killed you faster than planned.
There are a lot of ways that your opponents can outplay you, or you can make mistakes allowing your opponents to outplay you, so the safest way to take a barracks, or attempt to take a barracks is to do a Gank and Push.
Gank and Push Strategy
When you do a gank and push, you generally grab an item called a smoke of deceit which makes your team invisible to enemy wards and creeps (but nearby enemy heroes and towers will reveal you). You push your lanes away from your base, smoke your team, jump on whatever hero you see on the map, and all of the sudden you have their death timer in time to force a team fight where it's 5v4.
When you have a hero advantage like that there's a really good chance that you also have a gold+exp advantage in that team fight as well, since some of the enemy team's gold is now sitting around waiting to respawn.
A gank and push is a very standard method to give you an advantage when pushing that gives you a better chance to take an enemy barracks even if you're behind in gold and exp. If you are in any way worried about winning the teamfight, attempt to gank and push.
Another basic version of this is to kill Roshan, which drops an Aegis of the Immortal item which your carry should usually pick up. If you die with Aegis, you are only dead for 5 seconds, upon which you respawn at full HP where you died. When you push with Aegis, you essentially have 6 heroes instead of 5, which in a way also gives you a gold and exp advantage. These are the 2 safest ways to push! Use one of them when you're preparing to take an enemy barracks to increase your chance of winning.
5 Manning Strategy
5 Manning is the counter to the gank and push. When your team 5 mans, you are moving around the map in a group of 5 in case a teamfight starts. It counters gank and push because you wait for you opponents to start a 5v1 fight, but in reality it's a 5v5. If your team has better teamfight heroes, or you think you have the gold advantage, then you will usually 5 man to protect your heroes from getting ganked, and the enemy team performing a gank and push.
5 man strategies can be very frustrating to deal with especially if you're playing a ganking hero like Bounty Hunter or Riki. Those heroes strive on killing heroes that are by themselves, so if your opponents are 5 manning it's difficult to kill someone without being punished.
The counter to 5 manning is to split farm and split push.
To explain this lets talk about farming efficiency.
The fastest way to farm the map is to have 5 heroes in different places on the map killing jungle camps. 1 can be farming each lane, 2 heroes can farm each jungle, or a variation like that. This isn't very safe because it gives your opponents many choices for ganks, but it gets your team a LOT of gold.
If a team is 5 manning, they can't farm very rapidly because they are moving in a very small clump which has the farming efficiency of about 2 heroes.
To counter this, as boring as it is, you need to spread across the map(with good ward vision), and farm random places on the map where the enemy 5 heroes aren't farming. If you do this without getting killed(due to seeing where their clump is moving because of your wards), you will be gaining more gold and exp than your opponents.
They want to force a fight because they have gold advantage and good teamfight heroes (hence why they 5 man), and you want to outfarm them by split farming until your team is strong enough to fight them.
Their counter to your split farming is to push with their gold advantage. If they push all of your towers while you split farm, they easily get more gold advantage if they do it fast since towers give a lot of gold advantage. If they push your high ground and take a Rax, it also doesn't matter if you've been split farming. Raxes are far too important to let fall, so they force you to teamfight, which gives them an advantage.
To counter their push, you either need to endlessly counterpush by spamming ranged skills that kill their creeps, and prevent their push, or you need to Split-push, which is often called Rat Dota.
Split Pushing Strategy
Split pushing is best explained by using a vermin or rat analogy. Lets say you are 1 person in a large room and there are rats around the room that you're trying to kill because they are eating your cheese spread across the floor of the room. When you go to chase 1 rat away in one corner, that rat escapes into a hole and the other rats in the room are in the mean time eating cheese. You then run to the other side of the room to stop those rats, but the rat that you first chased away has reappeared.
To defeat 5 man, you have to channel your inner rat, and to do this you have to push all of the lanes that your opponents aren't pushing. For example, there are a couple heroes that are good at split pushing, and they usually have units they can summon to tank damage, and they have high physical or tower damage.
While your opponents 5 man and attempt to push towers, you are threatening to take a tower by yourself, just 1 hero. It usually takes a little longer than when 5 heroes do it, but if their towers are constantly threatened with split push, it becomes very dangerous to push because they are likely to gain no more than your opponents, and while using less hero resources. To prevent an even trade, they will teleport 1 hero back to defend, and then the push usually can't continue because they no longer have 5 heroes to properly teamfight. By split pushing and split farming, you are delaying their way to take advantage (pushing due to 5 man) until your team is farmed enough to win a fight.
That may be a bit over your head if you are brand new to Dota, but I figured that some groundwork of what to do in the late game would be useful.
Just remember, the late game of Dota involves people farming items across the map, trying to avoid ganks which lead to pushes, controlling Roshan and his Aegis so that they can't push with that, and sometimes strategies of split push and 5 manning.
At lower levels you will mainly see 5 people farming the entire game until team fights happen and a gank and push becomes easy, but don't be afraid to start thinking about how to counter those kinds of strategies.