It's actually a linear (more generally, abstract) algebra thing. (All, Differentiable, Smooth, or all sorts of other sets of) functions form a vector space. The derivative is a linear operator (generalized matrix). If you have a linear equation Ax=b, then if you can find some solution X, the general solution set is X+kerA, where kerA (the kernel or nullspace) is the set of all v where Av=0. What's the kernel of the derivative operator (i.e. what has 0 derivative)? Constant functions. So the general solution is whatever particular antiderivative you find plus any constant function.
You can do this sort of "particular solution plus kernel" analysis on any linear operator, which gives one strategy for solving linear differential equations. e.g. (aD^2+bD+cI) is a linear operator (weighted sums and compositions of linear operators are linear), so you can potentially do that analysis to solve problems like af''+bf'+cf=g. In that context you say the general solution is to add a homogeneous solution (af''+bf'+cf=0) to a particular solution (my intro differential equations class covered this but didn't have linear algebra as a prereq so naturally at the time it was just magic, like everything else presented in intro diffeq).
it basically works outside of linear algebra also. For instance the function f(x,y) = x^2 + y^2 - 1 has as its 'kernel' the circle x^2 + y^2 = 1.
Indeed, the connection to Stokes here is via the fact that both operators (abstracted derivative and antiderivative) are linear operators.