The majority of the time it is really not necessary to book ahead. Part of your Camino is going with the flow and living in the moment. However, there are times when the Camino is very crowded. You can call ahead or ask the Hospitalero where you are staying call ahead for you if you don’t speak Spanish to make a reservation. Not all albergues will accept a reservation, typically only private ones and then usually only until a specific time.
Booking.com is an excellent site use for reserving a hotel or even a Casa rural.
There are some places that need prior booking. Refuge Orission in the Pyrenees is a prime example. The hostel Beilari in St.-Jean-Pied-de-Port is another. It only has 18 beds and is very popular. The only other place that you might want to consider reserving a room might be Santiago de Compostela as it is very crowded a certain times of the year.