In this paper we first study the structure of the scalar and vector-valued nearly invariant subspaces with a finite defect. We then subsequently produce some fruitful applications of our new results. We produce a decomposition theorem for the vector-valued nearly invariant subspaces with a finite defect. More specifically, we show every vector-valued nearly invariant subspace with a finite defect can be written as the isometric image of a backwards shift invariant subspace. We also show that there is a link between the vector-valued nearly invariant subspaces and the scalar-valued nearly invariant subspaces with a finite defect. This is a powerful result which allows us to gain insight in to the structure of scalar subspaces of the Hardy space using vector-valued Hardy space techniques. These results have far reaching applications, in particular they allow us to develop an all encompassing approach to the study of the kernels of: the Toeplitz operator, the truncated Toeplitz operator, the truncated Toeplitz operator on the multiband space and the dual truncated Toeplitz operator.