The notion of product $X\times X$ for an object $X$ of a category $C$ resembles the notion of homotopy between two continuous functions. Indeed the relevant diagrams look the same:
\begin{array}{ccccccc} &&X&&&&X\\ &\nearrow&\uparrow&&&\nearrow&\uparrow\\ Y&\dashrightarrow&X\times X&&Y&\dashrightarrow&X^{[0,1]}\\ &\searrow&\downarrow&&&\searrow&\downarrow\\ &&X&&&&X \end{array}
On the left: $X$ and $Y$ are objects of a category, the vertical arrows should be thought of as "projections" on each of the two factors, the diagonal arrows are any two maps and the dashed arrow is the unique map factoring both (definition of product via universal property).
On the right: $X$ and $Y$ are topological spaces, the map space $X^{[0,1]}$ carries the compact-open topology, the vertical arrows are the two evaluation maps (at 0 and at 1), the diagonal arrows are two homotopic maps and the dashed arrow is a homotopy between the two.
We can also revert the arrows and get the same resemblance, this time between the notion of coproduct and, again, homotopy (provided we substitute $X^{[0,1]}$ with $X\times [0,1]$ etcetera).
My (admittedly vague) question is then the following:
Is there something interesting behind this resemblance, perhaps in a more abstract setting?
I recognise that the two situations are considerably different: in the left diagram, if the product object exists then any two maps (the diagonal arrows) admit a unique dashed arrow. In the right diagram, instead, only some pairs of maps admit a dashed arrow and this arrow is usually highly non-unique. However, the striking resemblance of the two diagrams encouraged me to ask the question. Perhaps an answer will involve the adjunctions between the product or coproduct functor and the diagonal functor?