TITLE: What's a good motivating example for the concept of a slice category?
QUESTION [16 upvotes]: What nice example can one give a beginner to really motivate the idea of a slice category, before they've met the more general notion of a comma category? 
There's the toy example of a poset category with the slices as principal ideals -- but that doesn't exactly elicit the thought "Yep! That's pretty interesting ..."

REPLY [6 votes]: From the perspective of categorical logic, slice categories are also interesting. 
First, recall that the main principle of categorical logic is that categorical structures arise from various forms of logical calculi by having propositions as objects and proofs or provability (depending on whether the calculus includes proofs or not) as morphisms (up to some equivalence).
Passing to the slice category over an object $P$ then means studying the  logical calculus in the context of $P$.
Consider the simplest example of propositional, intuitionistic logic. There, having propositions $P$ up to logical equivalence as objects and provability of $P\to Q$ as the morphism set $\text{Hom}(P,Q)$ yields the concept of a Heyting algebra: a skeletal Cartesian closed category in which any morphism set is either empty or a singleton. 
In such a Heyting algebra ${\mathcal H}$, passing to the slice category ${\mathcal H}/I$ over (the class of) a proposition $I\in {\mathcal H}$ means looking at propositions $P\in{\mathcal H}$ only for which $\text{Hom}_{\mathcal H}(P,I)\neq\emptyset$, i.e. those $P$ where $(P\Rightarrow I)=1$ in ${\mathcal H}$ ("$P$ implies $I$"). This is the same as the Heyting algebra attached to the modified logical calculus which has the same propositions $P,Q,...$, but in which a proof of "$P$ implies $Q$" is now a proof of "$P$ implies $Q$ under hypothesis of $I$" (or $P\wedge I\Rightarrow Q$ or $I\vdash P\Rightarrow Q$ in sequent style) in the old calculus, as apposed to just $P\Rightarrow Q$ or  $\emptyset\vdash P\Rightarrow Q$ before.
In general, properties of the slice categories of a given category correspond to which kind of logic can be interpreted in the category. 
For example, one might generalize the propositional intuitionistic logic from above, which can be interpreted in any Heyting algebra, to intuitionistic first order predicate logic: The latter can be seen as propositional intuitionistic logic fibered over the possible contexts of free variables, with introduction of unused variables and quantification allowing for passage between these contexts, and correspondingly it can be interepreted roughly in any category ${\mathcal C}$ in which for any "context" $X\in{\mathcal C}$ the subobjects of $X$ form a Heyting algebra, and in which pullbacks $\pi_X^{\ast}: {\mathcal C}/_{X}\to{\mathcal C}/_{X\times Y}$ (introducing unused, free variables) has a left adjoint $\exists_x$ and a right adjoint $\forall_x$. For example, one might take ${\mathcal C}=\text{Set}$, which gives the usual semantics of first order logic in set-models, but also ${\mathcal C}$ any elementary topos, which gives the Kripke-Joyal semantics.
More generally, in a category ${\mathcal C}$ with finite limits in which for any $f: X\to Y$ the pullback functor $f^{\ast}: {\mathcal C}/_{Y}\to {\mathcal C}/_{X}$ has both left and right adjoints $\exists_f,\forall_f: {\mathcal C}/_{X}\to{\mathcal C}/_{Y}$ (a locally Cartesian closed category), you may interpret intuitionistic higher order logic.