The compression of the median nerve causes carpal tunnel syndrome as it passes through the carpal tunnel and enters into the palm.
The carpal tunnel is a narrow passageway located on the anterior aspect of the wrist. The bones form a deep part of the carpal arch while the flexor retinaculum makes the superficial part.
More info: https://www.painreliefasap.com/the-truth-about-carpal-tunnel-syndrome/