Convert values of barometer from millibars to meters

Hi ,

I wanted to know how does PX4 v1.8.2 convert the readings from barometer (millibars) to meters (relative)? I saw that on Qgroundcontrol that altitude(rel) was displayed in meters , how is that acheived . What conversion do they use ?

Also, GPS module also does give altitude above MSL (mea sea level) , which is used while performing autonomous flight ? and how accurate is that reading

Appreciate any help on this .
Thanks in advance