Accurately predicting the critical gas velocity and inclination angle is crucial for gas field development. However, the mechanism of liquid loading remains elusive due to insufficient attention given to the multivaluedness of flow structures and phase non-uniformity. This paper theoretically studied the flow pattern and gas-liquid configuration in wellbore based on the minimum energy principle. The Kelvin-Helmholtz instability of liquid film was analyzed, and a new correlation for the interfacial friction factor was proposed based on wave properties. The results indicated that the flow pattern transitioned from stratified to annular flow as the inclination angle increased. The gas-liquid interface presented a curved shape, with the interface curvature being influenced by various factors such as fluid properties, tube diameter, inclination angle, and gas and liquid velocities. As the inclination angle increases, the critical gas velocity first increases and then decreases, reaching a peak between 44° and 59°, aligning well with experimental and conventional results. Larger tube diameter, higher liquid density, and viscosity result in a higher critical gas velocity. Waves are more prone to develop in inclined pipes, and capillary waves can break up liquid film due to instability, leading to a discontinuous flow in inclined tubes. Film instability is exacerbated by a smaller diameter, higher liquid holdup, or greater inclination angle. Finally, a new model was devised to predict liquid loading in inclined natural gas wells, demonstrating better performance than existing models. In practice, the present model can achieve real-time prediction of critical gas velocity and continuously monitor the location of liquid accumulation in gas wells over the lifespan.