Stack Overflow is the worlds largest community of software developers.
Software developers are in crazy high demand - and most already have jobs. Companies really struggle to fill their developer roles.
Companies pay Stack Overflow to list their jobs on the jobs section of the website, and to advertise their specific roles on different parts of the website.
Stack Overflow makes sure companies show the relevant content that developers want to see (such as tech stack, salary, etc).
Win win win- Stack Overflow gains revenue, companies find software developers, software developers find jobs. :)