Following the car in front of you too closely can be a hazardous situation. It could stop or turn quickly in front of you and there may not be enough distance between your vehicle and the vehicle in front to react accordingly.
The distance that it will take you to stop in an emergency depends on the speed at which you are travelling. The faster you travel, the further it takes you to stop. For example, in the best possible driving conditions, travelling at 60km/h it takes 45 metres to stop, while travelling at 50km/h takes 35 metres - that's 10 metres less and the difference between avoiding a hazard and having a crash.
This means that as you increase your speed, you must also increase the distance between you and the vehicle in front. An easy guide to judge your distance is what is called the "2-second rule".