The guide will do his/her best to get rooms for you. We can't guarantee it but we have never had any trips where the guide has not been able to secure rooms for their clients. For small trekking groups, lodge owns sometimes do not honor reservations if they even take them. However, the guides usually know some of the lodge owners and operators and are able to call ahead and get rooms in the few places where there is sometimes a short supply. The best way to guarantee rooms is to leave early and/or send a porter ahead to hold rooms. You will definitely have a place to sleep, worst case you would need to sleep in a dining area. Again, that has never happened with any of the trips run by guides booked on our site, and is more common with independent trekkers who arrive late in the day to places where there is an under supply of rooms.
More about lodging on treks can be found at our blog: Teahouses & Trekking Lodges in Nepal