What does it mean to be compatible with the isomorphism structure of a class? Let $\mathrm{UR}$ denote the class of all unital rings and $\mathrm{Set}$ denote the class of all sets. Actually, perhaps it would be better to view $\mathrm{UR}$ as the groupoid whose objects are unital rings and whose morphisms are unital ring isomorphisms.
In any event, consider the following functions.


*

*The function $f : \mathrm{UR} \rightarrow \mathrm{Set}$ such that $f(R) = $ the set of all irreducible elements of $R$.

*The function $g$ defined on $\mathrm{UR}^2$ such that for all rings $X$ and $Y$, we have that $g(X,Y) = (0_X,1_Y).$
I'm guessing that both these functions are "compatible" with the natural isomorphism structure of $\mathrm{UR}$, in some sense.
What is the appropriate sense?
 A: A completely agree with Zhen Lin's comment above, functoriality is the answer. 
What I mean is that probably what you have noticed is that those maps have the property that are the objects function of some functors.
Here are the details.
For now let's just consider the first mapping.
You have defined a map $f \colon \mathbf{Obj}(\mathbf{UR}) \to \mathbf{Obj}(\mathbf{Set})$ between the classes of rings and sets.
Now if you consider every $\alpha \in \mathbf{Ar}(\mathbf{UR})$ which is simply an isomorphism $\alpha \colon R \to S$ between the rings $R$ and $S$, this is a mapping such that $\alpha(f(R)) \subseteq f(S)$, i.e. $\alpha$ sends irreducible elements of $R$ in irreducible elements of $S$.
This tells that we can restrict the isomorphism $\alpha$ to a function 
$$f(\alpha) \colon f(R) \to f(S)$$
that sends every $x \in f(R)$ in the element $\alpha(x) \in f(S)$.
This extend $f$ to a mapping 
$$f \colon \mathbf{Ar}(\mathbf {UR}) \to \mathbf{Ar}(\mathbf{Set})$$
which sends every $\alpha \in \mathbf{Ar}(\mathbf{UR})$ in $f(\alpha)$ defined as above.
It's easy to prove that in this way the two mappings, the one on the objects and the one on the arrows give us a functor 
$$f \colon \mathbf{UR} \to \mathbf{Set}$$
A similar construction can be done for the other mapping to obtain a functor
$$g \colon \mathbf{UR} \times \mathbf{UR} \to \mathbf{Set}$$
which extend the maps you defined in the question, which is a map of type
$$g \colon \mathbf{Obj}(\mathbf{UR}\times\mathbf{UR}) \to \mathbf{Set}$$
In this case the construction is a little more subtle since it requires to deal with definition of an ordered pair as a set. But the basics is the same, the mapping $f$ and $g$ are the objects functions part of two functors, or if you prefer the mapping defined can be extended to two functors between the categories involved. 
Edit: after the comment of user18921 I think some additional information are needed.
For start we can see that a category is a sort of algebraic structure, with two collections, a collection $C_0$ for the objects and a collection of morphisms $C_1$, and four operation between them 


*

*source and target operations: $s,t \colon C_1 \to C_0$ which assign to morphisms objects;

*a binary partial operation $\circ \colon C_1 \times C_1 \to C_1$ which is defined just for all ordered pairs $(g,f) \in C_1 \times C_1$ such that $t(f)=s(g)$ and associate to such pair the morphism $g \circ f$;

*an identity operation $i \colon C_0 \to C_1$ which assigns to every object a morphism.


Such operations are required to satisfy some condition, for more details I suggest to take a look here.
The main difference between categories and other ordinary algebraic structures is that categories deal with two sort, the collection of objects and the one of the morphisms, while ordinary algebraic structures have one sort, with the exception of modules.
Being a such sort of structure in natural to require that morphisms of categories $\mathbf C$ and $\mathbf D$ are given by two pair of operations
one between the object-collections
$$ C_0 \rightarrow D_0$$
and one between the morphisms
$$C_1 \rightarrow D_1$$
in such a way to preserve the operations of the category.
A functor do exactly this, and so functors are the natural notion of morphisms which preserve the structure of category.
In the end there are some particular categories: those where every morphisms have an inverse for composition, such categories are called groupoids and for every category there's a canonical groupoid associated to it, the subcategory of all invertible morphisms (isomorphisms) in it.
