All posts are referred to by an ID number. It's not only questions. Every question and answer has a sequential post ID that shares an order - a question and an answer will never have the same ID as each other on the same Stack Exchange site. These ID numbers are stored in our database as the one true reference to any post. In combination with the site URL, they're unique.
We use IDs everywhere - this is what allows usernames to be non-unique - we don't care about the text you choose for your username, we only care about the profile ID you're assigned when you join the site.
This makes it really simple to allow for the editing of the title or a username without mucking with the links and having to create redirects every single time someone updates the title of the question or their username. The system simply ignores the information after the ID as it's mostly just there to be more understandable to people, particularly in a long list of URLs.
Having the title text included in the link to questions is actually to help it be human-readable and search engine friendly, which I personally use a lot - unless I need the short version of the URL for space concerns, I always use the full-length URL.
So, we do both! We help the system be more simple by including the ID number and we help it be readable by people by including the title.
logic-behind...
part is actually redundant. (meta.stackexchange.com/questions/36714/…)