  In its simplest form, the theory of regular languages is the study of sets of
finite words recognized by finite monoids. The finiteness condition on monoids
gives rise to a topological space whose points, called profinite words, encode
the limiting behavior of words with respect to finite monoids. Yet, some
aspects of the theory of regular languages are not particular to monoids and
can be described in a general setting. On the one hand, Boja\'{n}czyk has shown
how to use monads to generalize the theory of regular languages and has given
an abstract definition of the free profinite structure, defined by codensity,
given a fixed monad and a notion of finite structure. On the other hand,
Salvati has introduced the notion of language of $\lambda$-terms, using
denotational semantics, which generalizes the case of words and trees through
the Church encoding. In recent work, the author and collaborators defined the
notion of profinite $\lambda$-term using semantics in finite sets and
functions, which extend the Church encoding to profinite words.
  In this article, we prove that these two generalizations, based on monads and
denotational semantics, coincide in the case of trees. To do so, we consider
the monad of abstract clones which, when applied to a ranked alphabet, gives
the associated clone of ranked trees. This induces a notion of free profinite
clone, and hence of profinite trees. The main contribution is a categorical
proof that the free profinite clone on a ranked alphabet is isomorphic, as a
Stone-enriched clone, to the clone of profinite $\lambda$-terms of Church type.
Moreover, we also prove a parametricity theorem on families of semantic
elements which provides another equivalent formulation of profinite trees in
terms of Reynolds parametricity.
