Sometimes (more rarely than people think) a single entity plays both roles, but it's impossible to reason about this space if you conflate the two
Yes, developers build homes to make money. This is how approximately 100% of the housing supply in the US was created.