What are x and y based on for position control?

Hello! I am fairly new to ardupilot and am working on my first autonomous flight mode. One thing I am doing is using lidar measurements to fly a multi-rotor copter alongside a beam. My question is: Is the X and Y system in position control mode based on the direction the copter is facing? Or is it based on the compass? For example, If i added 5 cm to x using AC_PosControl::shift_pos_xy_target(), would the copter fly 5 cm to the left/right or forward/back? Or would it fly 5cm in either the North/South or East/West directions? I looked a while online for the answer, but like i said, I’m very new to ardupilot.

Any help is appreciated!