This question was prompted by the following example:
If $X$ is compact then $C(X)$ is a Banach algebra and if $U$ is an open subset of $X$ then $C_0(U)$ is a subalgebra of $C(X)$. Here $C(X)$ is endowed with $\|\cdot\|_\infty$ and $C_0(U)$ denotes all continuous functions $f:U \to \mathbb C$ such that for every $\varepsilon > 0$ the set $\{u : |f(u)|\ge \varepsilon\}$ is compact.
I don't understand how $C_0(U)$ can be a subset of $C(X)$: $f \in C_0(U)$ is only defined on $U$. In order for it to be in $C(X)$ it would need to be defined on $X$. How does this work?
Here's another example: Take $A$ to be the disk algebra. Then $C(S^1)$ is a subalgebra of $A$.
Unless $U = X$, it isn't strictly a subset. However, we have a canonical isometric embedding $\eta\colon C_0(U) \hookrightarrow C(X)$ given by
$$\eta(f) = x \mapsto \begin{cases} f(x) &, x \in U\\ 0 &, x \notin U. \end{cases}$$
Since $f(x) \to 0$ as $X$ approaches $\partial U$ for every $f\in C_0(U)$, the extension $\eta(f)$ is continuous, and
$$\sup_{x\in U} \lvert f(x)\rvert = \sup_{x\in X} \lvert \eta(f)(x)\rvert$$
(if one gives the left hand side the value $0$ in case $U = \varnothing$) is easily verified.
For the other example, the disk algebra, the situation is different but similar. Again, we have no strict subset relation, but a canonical embedding. For $f \in A$, the boundary values $f\lvert_{\partial \mathbb{D}}$ are continuous, and the map
$$\iota \colon A \hookrightarrow C(S^1);\qquad \iota(f) = f\lvert_{S^1}$$
is an isometric embedding (due to the maximum principle for holomorphic functions).
When we have a natural (isometric) embedding of one algebra into another, we often tacitly omit the embedding and view it as a subalgebra, not as an algebra isometrically isomorphic to a subalgebra.