Headers in HTTP/2 provide information about the request or response. Header take around 800 bytes of bandwidth and sometimes few KB if it carries cookies. Therefore compressing headers can reduce the bandwidth latency.
So HTTP/2 introduced header compression. Header compression is not like request/response body gzip compression rather its a technique of not sending the same headers again.
For every TCP connection the client and server maintain a headers table containing the last response and request headers and their values respectively. For the first request or response they send all the required header. But for subsequent requests client and server omit headers which are same as the previous request or response. Those missing headers are retrieved from the headers table thus decreasing the overall length of the headers data in a request or response.
Side Note: All the header fields of HTTP/1.1 remains the same in HTTP/2. Just the first line of the HTTP/1.1 request is split into key-value pairs i.e.,