Gank

Ganking is the act of ambushing an unsuspecting enemy champion. Hiding in brush and waiting for an enemy to get too close is the most common form of ganking.

Effective Ganking
If your team has a jungler, you will be able to set up ganks very effectively. Letting the enemy push a lane allows your jungler to come up behind them and prevent an escape. Baiting enemies (sticking around if you have low health and/or mana) is a good way of getting enemies to play too aggressively, causing them to be easily distracted from watching for ganks.

Warding the Dragon or Baron on Summoner's Rift allows your team to see when enemies are attacking those key points. An effective team can then overcome the preoccupied enemies, even stealing the kill. Ganking a team in the middle of them doing baron is extremely risky but can often result in an ace and a steal of the buff, which can turn the tides on almost any battle.

Prevent Ganking
If the enemy team has a jungler, or if an enemy is able to easily switch between lanes, the best way of preventing an incoming gank is to ward brush. Good places for wards are on either side of the middle lane, the bottom brush for the top lane, or the top brush for the bottom lane. Placing one in front of Dragon or Baron is also advised, as not only can it help create ganks like above, but it can also alert you to an incoming champion sooner than the ward in the brush does - allowing for a counter-gank to possibly occur.

Be wary of baiting as well. If a champion has very low health or mana, and is straying far from their turret only to run back to it, you may want to check nearby brush to ensure that they're not leading you into an ambush. Alternatively, you can stop pressing the lane, pulling back to your turret until you have backup enough to feel confident that a gank won't work.

Even without wards, it can be easy to tell when you will be the target of a gank. If the entire enemy team is missing and you are solo pushing a turret, you will want to go hide or recall back to base. It's likely that the team will show up to defend the turret within seconds of you leaving.

It is very important to keep an eye on large masses of enemies. If there are a group of enemy champions in the middle lane, them may kill a group of minions and press on. However, since you still have a view of enemies for a few seconds after the minions die, you are able to tell if they are changing direction and heading towards an unsuspecting ally.

Counter Ganking
If a team has extremely effective map awareness, a lot of wards, or a good Teemo, it is possible to counter gank an incoming enemy. If an ally is being chased, or you see an enemy leaving mid lane and heading for bottom, hide in brush in the direction they're heading. Gankers often hop from brush to brush, so you will be able to wait until they're almost on top of you before unleashing a devastating attack. Regardless of whether the enemy is killed or flees, it will make them think twice before trying it again.