The path-independence of line integrals, i.e., their only dependence of initial and final points of the paths but not their shapes implies that the line integral along all closed lines is zero. In a simply connected region of space and if the vector field in question is continuously differentiable in this region that follows from the vanishing of its curl (Poincare's Lemma)
\vec{\nabla} \times \vec{V}=0 \; \Leftrightarrow \; \int_{\mathcal{C}} \mathrm{d} \vec{r} \cdot \vec{V} \; \Leftrightarrow \; \vec{V}=-\vec{\nabla} \Phi.
In the same way you can show that a vector field whose integral over any closed surface vanishes in a region, where each such surface can be continuously contracted to a point is a solenoidal field and its divergence vanishes:
\vec{\nabla} \cdot \vec{V}=0 \; \Leftrightarrow \; \int_S \mathrm{d}^2 \vec{F} \cdot \vec{V}=0 \; \Leftrightarrow \; \vec{V}=\vec{\nabla} \times \vec{A}.
From this it follows the Helmholtz decomposition theorem, i.e., for any sufficiently well-behaved vector field in sufficiently nice regions of space you can write
\vec{V}=-\vec{\Phi}+\vec{\nabla} \times \vec{A}.
The scalar potential \Phi is determined from its sources, i.e.,
\vec{\nabla} \cdot \vec{V}=-\Delta \vec{\Phi}
and the vector potential \vec{A} from its vortices,
\vec{\nabla} \times \vec{V}= \vec{\nabla} \times (\vec{\nabla} \times \vec{A}).
Since \vec{A} is only defined up to a gradient field, you can demand
\vec{\nabla} \cdot \vec{A}=0,
and then the latter equation simplifies to (in Cartesian coordinates)
\Delta \vec{A}=-\vec{\nabla} \times \vec{V}.
So you get the decomposition with help of any Green's function of the Laplace operator that satisfies the boundary conditions suitable for your problem:
\Phi(\vec{x})=\int \mathrm{d}^3 \vec{x}' G(\vec{x},\vec{x}') \nabla' \cdot \vec{V}(\vec{x}')
and
\vec{A}(\vec{x})=\int \mathrm{d}^3 \vec{x}' G(\vec{x},\vec{x}') \nabla' \times \vec{V}(\vec{x}').
The Green's function satisfies
\Delta_{\vec{x}} G(\vec{x},\vec{x}')=-\delta^{(3)}(\vec{x}-\vec{x}').
For free space we have
G(\vec{x},\vec{x}')=\frac{1}{4 \pi |\vec{x}-\vec{x}'|},
i.e., the electrostatic potential of a unit point charge located at \vec{x}' (Coulomb potential).