Using the dynamical system approach, we describe the general dynamics of cosmological scalar fields in terms of critical points and heteroclinic lines. It is found that critical points describe the initial and final states of the scalar field dynamics, but that heteroclinic lines which give a more complete description of the evolution in between the critical points. In particular, the heteroclinic line that departs from the (saddle) critical point of perfect fluid-domination is the representative path in phase space of quintessence fields that may be viable dark energy candidates. We also discuss the attractor properties of the heteroclinic lines, and their importance for the description of thawing and freezing fields.