Suppose we are in a category $\mathcal{C}$ and we have monad on this category, written as $(P,\sigma, \mu)$. We can consider the category of $P$-algebras. Among its elements is are the free algebras, which are of the form $(P(X),\mu_X)$, for some object $X$. In most cases, like with groups or monoids, the construction of such a 'free' object has the following universal property: If there is another object $T$, and a map $t:X\to T$, then this extends in a unique way to a lift $\hat{t}:P(X)\to T$, making the obvious triangle commute. It seems to me that this also holds in the more abstract case, for an arbitrary category and an arbitrary monad. However, I fail to find a source which elaborates on this subject explicitly, and only found a source which just mentions it as a result. Does anyone have an argument why this should, or should not, be true?
Thanks in advance!
In the comments, you say you are happy with the adjunction $F^P \dashv U^P$, where $U^P\colon \mathsf{P{-}Alg}\to C$ takes a $P$-algebra $(X,\alpha)$ to its underlying object $X$ and $F^P\colon C\to \mathsf{P{-}Alg}$ takes an object $X$ to the free algebra $(P(X),\mu_X)$. This adjunction means exactly the same thing as the universal property you're interested in - it's just a more concise way of writing it down.
Let $X$ be an object in $C$ and let $(Y,\alpha)$ be a $P$-algebra. Then the adjunction tells us that $\text{Hom}_{\mathcal{C}}(X,Y) = \text{Hom}_{\mathcal{C}}(X,U^P(Y,\alpha)) \cong \text{Hom}_{\mathsf{P{-}Alg}}(F^P(X),(Y,\alpha))$. So for every arrow in $C$ from $X$ to the underlying object of the $P$-algebra $(Y,\alpha)$, there is a unique $P$-algebra morphism $F^P(X)\to (Y,\alpha)$ from the free $P$-algebra on $X$ to $(Y,\alpha)$.
Now you'd like to know something a bit more - not just that there is a natural bijection between $\text{Hom}_{\mathcal{C}}(X,Y)$ and $\text{Hom}_{\mathsf{P{-}Alg}}(F^P(X),(Y,\alpha))$, but that the arrow $U^P(f)\colon P(X)\to Y$ defining the $P$-algebra homomorphism $f\colon F^P(X)\to (Y,\alpha)$ "lifts" the corresponding arrow $g\colon X\to Y$ in $C$, in the sense that $U^P(f)\circ\sigma_X = g$. To do this, we need to dig in a bit more into how the adjunction works. And there's a standard way to understand an adjunction as a universal property. You can skip this whole section if you're already familiar with it.
Ok, back to the concrete case of $P$-algebras. If you understand the adjunction $F^P\dashv U^P$, you can compute that for any $X\in C$, $U^P(F^P(X)) = P(X)$, and the unit $\eta_X$ of the adjunction is just the unit of the monad $\sigma_X\colon X\to P(X)$. So if $g\colon X\colon U^P(Y,\alpha) = Y$ is an arrow from $X$ to the underlying object of a $P$-algebra $(Y,\alpha)$, and $f\colon F^P(X)\to (Y,\alpha)$ is the corresponding homomorphism of $P$-algebras, then $f$ and $g$ are related by $g = U^P(f)\circ \eta_X = U^P(f)\circ \sigma_X$. This is exactly the "lifting" commutative triangle we wanted.