Installation of older versions of SharePoint is agnostic of role. It’s the services that farm admins provision that determines the server role. E.g. on a search server, farm admins provision Search Service and the related services. Similarly different set of services are provisioned on an application server and front-end server.
SharePoint 2016 introduces a concept called MinRole, aka. Server Roles, which is designed to transform guidance to code. This concept helps in implementing best practices for optimizing performance for the role type. MinRole/Server Role can be configured both by using powershell (PSConfig) and the gui (PSConfigUI)