Just a guess ... but I suspect they don't "ask" to be polite, but for legal reasons so they can say you consented to the search should the matter go further.
I've had my bags checked many times at many different airports and they've always "asked" and I've always consented.