  In this dissertation, we present for each natural number $k$, semantic
characterizations of the $\exists^k \forall^*$ and $\forall^k \exists^*$ prefix
classes of first order logic sentences, over all structures finite and
infinite. This result, that we call the *generalized {\L}o\'s-Tarski theorem*,
abbreviated $\mathsf{GLT}(k)$, yields the classical {\L}o\'s-Tarski
preservation theorem when $k$ equals 0. It also provides new characterizations
of the $\Sigma^0_2$ and $\Pi^0_2$ prefix classes, that are finer than all
characterizations of these classes in the literature. Further, our semantic
notions are finitary in nature, in contrast to those contained in the
literature characterizations.
  In the context of finite structures, we formulate an abstract combinatorial
property of structures, that when satisfied by a class, ensures that
$\mathsf{GLT}(k)$ holds over the class. This property, that we call the
*Equivalent Bounded Substructure Property*, abbreviated $\mathsf{EBSP}$,
intuitively states that a large structure contains a small "logically similar"
substructure. It turns out that this simply stated property is enjoyed by a
variety of classes of interest in computer science: examples include words,
trees (unordered, ordered or ranked), nested words, graph classes of bounded
tree-depth/shrub-depth, and $m$-partite cographs. Further, $\mathsf{EBSP}$
remains preserved under various well-studied operations, such as
complementation, transpose, the line-graph operation, disjoint union, cartesian
and tensor products, etc. This enables constructing a wide spectrum of classes
that satisfy $\mathsf{EBSP}$, and hence $\mathsf{GLT}(k)$. Remarkably,
$\mathsf{EBSP}$ can be regarded as a finitary analogue of the classical
downward L\"owenheim-Skolem property.
  In summary, this dissertation provides new notions and results in both
contexts, that of all structures and that of finite structures.
