Unlike ideal surfaces, real surfaces do not have perfect smoothness, rigidity, or chemical homogeneity. Such deviations from ideality result in phenomenon called contact angle hysteresis, which is defined as the difference between the advancing (θ) and receding (θ) contact angles 
When the contact angle is between the advancing and receding cases, the contact line is considered to be pinned and hysteretic behaviour can be observed, namely contact angle hysteresis. When these values are exceeded, the displacement of the contact line, such as the one in Figure 3, will take place by either expansion or retraction of the droplet. Figure 6 depicts the advancing and receding contact angles. The advancing contact angle is the maximum stable angle, whereas the receding contact angle is the minimum stable angle. Contact angle hysteresis occurs because many different thermodynamically stable contact angles are found on a nonideal solid. These varying thermodynamically stable contact angles are known as metastable states.
Such motion of a phase boundary, involving advancing and receding contact angles, is known as dynamic wetting. The difference between dynamic and static wetting angles is proportional to the capillary number, , When a contact line advances, covering more of the surface with liquid, the contact angle is increased and is generally related to the velocity of the contact line. If the velocity of a contact line is increased without bound, the contact angle increases, and as it approaches 180°, the gas phase will become entrained in a thin layer between the liquid and solid. This is a kinetic nonequilibrium effect which results from the contact line moving at such a high speed that complete wetting cannot occur.
A well-known departure from ideal conditions is when the surface of interest has a rough texture. The rough texture of a surface can fall into one of two categories: homogeneous or heterogeneous. A homogeneous wetting regime is where the liquid fills in the grooves of a rough surface. A heterogeneous wetting regime, though, is where the surface is a composite of two types of patches. An important example of such a composite surface is one composed of patches of both air and solid. Such surfaces have varied effects on the contact angles of wetting liquids. Cassie–Baxter and Wenzel are the two main models that attempt to describe the wetting of textured surfaces. However, these equations only apply when the drop size is sufficiently large compared with the surface roughness scale. When the droplet size is comparable to that of the underlying pillars, the effect of line tension should be considered.