  We establish a new connection between local and large-scale structure in
compactly generated totally disconnected locally compact (t.d.l.c.) groups $G$,
finding a sufficient condition for $G$ to have more than one end in terms of
its compact subgroups. The condition actually results in an action of a
quotient group $G/N$ on a tree with faithful micro-supported action on the
boundary, where $N$ is compact, and is closely related to the Boolean algebra
formed by the centralisers of the subgroups of $G/N$ with open normaliser. As
an application, we find a sufficient condition, given a one-ended t.d.l.c.
group $G$, for all direct factors of open subgroups of $G$ to be trivial or
open.
