GPS (Global Positioning System) is a technology created and financed by the United States military. The GPS system consists of a large number of satellites in low-earth-orbit. It is used by many situations, including shipping, aviation, transportation and navigation.
Your phone calculates your location on earth by comparing the distance to three satellites. There are many factors that could impede the phone's ability to receive messages from the GPS satellites. Being surrounded by high rise buildings might obstruct or delay the signal and being underground makes triangulation impossible.
A geofence is an area around a single GPS coordinate or a shape created by drawing lines between three or more GPS coordinates. The phone's GPS location is compared to the geofence areas in the system to determine if the user is inside or outside a geofence.
In the X.bike system, geofences are used to create parking spots. The size of each geofence parking spot can be customised to suit the situation.