After choosing a lender, you may be quoted a rate, which may "float" until the actual closing, meaning that it is not guaranteed. With a lock-in you are guaranteed that the interest rate will not change before your closing. You may want to ask for an agreement that ensures that your rate is capped, but allows you to take advantage of a lower rate if the rate lowers before your close.
There is usually a time limit that a lender will put on this guarantee, and if you don't close before that time, they no longer have to honor that lock-in. It is recommended that you stay in close contact with your loan officer during the process to ensure that you are able to close in a timely manner and get the locked-in rate.