What is the purpose of GetCapabilities and GetMap request in WMS server? Like how they work when a request is being made to them.
The GetCapabilities gives you the capabilities of the service. It tells you the operations supported, the names of the layers, the styles of the layers, the coordinate reference systems supported, the media formats supported, any restrictions on display scale, the bounding boxes of the layers, and can give supplementary information about the data that make up the layers.
GetCapabilities is an operation common to all OGC services not just WMS.
GetMap is the operation to create a map, according to the ingredients you choose, from the GetCapabilities response menu.