Firstly, are you attempting to use the built-in GPS capabilities of your iPad whilst onboard a commercial aircraft (such as an airline), or a smaller GA Aircraft? GPS signals are, essentially, line-of-sight; you must have a clear view of the sky to obtain sufficient satellite signals to both obtain and maintain an accurate position fix.
The built-in GPS receiver will be more reliable in a GA aircraft as the greater window surface area will permit more signals to penetrate the cabin. In commercial aircraft, in particular within the main cabin, any portable GPS receiver (such as iPad and iPhone) will struggle to maintain a position solution; too few satellites will be visible, with good geometry, to maintain a position solution.
The aircraft fuselage will block GPS/GNSS satellite signals. Very often, for reliable operation during flight, it is necessary to utilise a remote GPS/GNSS Satellite receiver (e.g., BadElf) - and connect to your iPad using either a Bluetooth or wired connection.