Airplanes are sometimes led by a vehicle on taxiways until they reach the runway or stand, why is this?
In addition to the reasons given by @Daniele, there are two others that I can think of: security and lack of visibility.
At Amsterdam Schipol for a time at least in the 1990s there were two airlines, El Al and Tower that were escorted from the gate to the runway and from the runway to the gate because there was a concern about what we would now call terrorist activity. They used a follow-me car in front and, as I remember, a light armored vehicle (wheeled, not tracked) at each wing and a following vehicle.
There are occasions, especially in 747s where the pilot eye level is high, that after landing in minimum conditions on a well lit runway (think centerline lighting, etc.) you turn off the runway only to find that you can't see the taxiway edges all that well. The solution is to call for a follow-me car. Once after landing on 22R at KJFK with the barest of minimums, we asked for a follow-me when we were concerned about being able to keep to the taxiway.
"Follow-me cars", as they are known, make it easier for pilots to get to the correct spot by the correct route.
This could be the runway before take-off, or the final stand after landing.
They're useful at airports with complex routes and relieve the pilots of some additional navigation burden; their function is one both of safety and convenience.
They might be used as a rule at a particular airport, or on request (if perhaps the pilot is unfamiliar with the taxiways, or there's an urgent need to get to a gate very quickly), or because of local conditions (signage or lighting problems, re-routing because of ground maintenance work).
However, the presence of cars around aircraft and runways is not without its own risks, and follow-me cars in fact add an extra layer of complication to airfield management.
(And sometimes, they have a rather odd marketing role... at Bologna (BLQ) one of the follow-me cars is a Lamborghini. Make of that what you will.)
It may be required by the airport authority for large aircraft.
For example, at LAX, there's a detailed operations plan (no clue if that's the most recent version) for how FAA group VI aircraft (such as the A380 and 747-8) move around the airport. The plan requires airport personnel to escort and monitor large aircraft since many taxi routes may cause the wings to encroach on the normal safety clearances. These aircraft are large enough to pose a hazard to service roads around the airport, and airport staff need to block traffic temporarily to accommodate movements.
Of course, having a follow-me car doesn't eliminate all risk of incidents.