Fins provide stability to rockets and help them to face the right direction, maintain a straight trajectory and not spin uncontrollably. The fins make the rocket much more aerodynamic, allowing for smoother motion through both air and water.
Once fins started to be added to rockets, rockets quickly became more stable, accurate and practical. When lightweight fins are mounted to the back end of rockets, they are able to cut through the air in only one direction and provide drag if the air is pushing against them from the wrong angle. This means that the rocket can only point forward, and if the rocket gets off-course then the fins help to correct the flight path. When the flight path is straight, the rocket's accuracy and range are both increased.
Some rocket designers purposely placed the fins in a diagonal direction on the back of the rocket, which made the rocket spin extremely fast. Doing so allows for even greater accuracy, but provides some added drag which slows the rocket down and shortens its range. Most modern rockets have mechanical fins that can be controlled either by a computer or a human operator. This allows the rockets to change direction in the air and hit a target with incredible accuracy.