A router doesn't "change data-link header". It throws away an encapsulating frame on reception and creates a new encapsulating frame for transmission.
A router forwards between networks. These networks use a certain data link layer (L2) protocol and that is employed by the router to reach the next hop. For that, it encapsulates the packet to be transported in an (new) L2 frame and forwards it. Note that framing depends on the L2 protocol used on that link which can differ considerably (Ethernet, Wi-Fi, PPP, HDLC, ATM, Fibre Channel, Infiniband, ...) - thx @ilkkachu!
The next hop removes the frame and looks at the packet, repeating the process as long as it's necessary to reach the destination.
Think of the L2 frame as a vehicle for the packet while it's being transported across a certain network. Of course, the packet is a vehicle for the transport-layer datagram in turn. (Which is a vehicle for the application-layer data as well.)