The Server header is set by the web server software, for example nginx, Apache, Microsoft-IIS or LiteSpeed. X-Powered-By often names the language or framework behind it, such as PHP or Express.
These headers are information the server volunteers, so they can be wrong on purpose. For software that shows up in the page itself, use the Technology Detector.