Look at it this way. Let's say a friend of yours is getting married at a hotel in your hometown. You live in town, so it's not like you NEED to get a hotel room for the night. But you plan on drinking, so you like the idea of getting a room for the night so your drive home will consist of drunkenly pushing an elevator button.
Your friend is getting married on the 10th. You are going to stay one night. You check out on the 11th. Again, you stayed only one night, but you are staying from the 10th to the 11th.
So if you are arriving on the 13th and leaving on the 18th, you are paying for 5 nights ... you are paying to stay in the room on the nights of the 13th, 14th, 15th, 16th and 17th. Since you are staying there on the night of the 17th, you will wake up in the room on the morning of the 18th. You don't "pay" for the 18th because you are vacating the room early that day, and someone else will be checking-in to that room later that day.