Developers make the game. Publishers pay for it and sell it.
This is the studio that writes the code and produces the assets: models, textures, animation, audio, design, and all the engineering that makes it run. In the construction analogy, they are the people actually building the house.
The publisher finances development, markets the game, and handles manufacturing and distribution — discs, packaging, store placement, and increasingly storefront and platform deals. They are the ones funding the project and taking the commercial risk.
The relationship varies. Independent studios keep both roles, while large publishers own or contract multiple developers. When a game ships late or with rough edges, the cause is often tension between those two interests rather than a failure of either.