Faults form in the Earth's crust when stress from underlying rock movements causes the more brittle surface rock to crack or slip. The result is a discontinuity in the landscape that can be either laterally displaced, sunken or lifted up relative to the surrounding terrain. Fault lines can be very short and affect only a small area, or they can run for hundreds of miles.
Deep under the surface, rock can get very hot and soft. The movement of this layer relative to the surface puts stress on the uppermost layers of rock. Rock near the surface tends to be cooler and less malleable, which allows the stress from underneath to build until the surface rock cracks. The point of fracture can be very narrow, sometimes it's only a few inches wide, but the surrounding rock is usually distorted from the force of the movement.
Fault lines can be unpredictable. Depending on the composition of the local rock and the stress it's under earthquakes can be frequent or rare, mild or severe. Some heavily faulted areas, such as the New Madrid zone in the American Midwest, can lie dormant for millions of years before reactivating and forming new fractures in the landscape.