Why do people complain about lack of housing but oppose new developments?

I’ve been thinking about this contradiction and would love to hear others' perspectives. People often complain about the lack of housing and services in their area, but when new housing and services are proposed or built near them, they push back against it. Why does this happen? What’s the reasoning behind it?