The Reynolds Transport Theorem (RTT) is given by
$$\frac{B_{sys}}{dt} = \frac{d}{dt}\int_{CV}\rho\beta dV + \int_{CS}\rho\beta\vec{v}_r\cdot\vec{n}dA.$$
The RTT relates a Lagrangian system on the left to an Eulerian control volume (CV) with control suface (CS) on the right. The system consists of a marked mass. The term marked mass means we define our system in terms of the fixed masses that constitute it. Those masses don’t have to be contiguous, even at the molecular level.
In the RTT, $B_{sys}$ is an extensive property of the system, typically mass, momentum, energy, or the mass of a given molecule or element. $\beta = B_{sys}/m$ is the corresponding intensive quantity. $\vec{v}_r$ is the relative velocity between the system and the CS, that is $\vec{v}_r = \vec{v}_{sys} - \vec{v}_{CS}$. We allow the control volume to move and deform, though we more often assume it is fixed.
The RTT is a more general and flexible form of the familiar conservation expression “accumulation equals in minus out plus generation.” The left side of the RTT is the generation term. The first term on the right is the accumulation term, and the second term on the right is the transport term, out minus in.
The purpose of the RTT is to connect the Lagrangian system to the Eulerian control volume. We normally want conservation equations for Eulerian systems, but conservation laws are written for Lagrangian systems. Then the RTT connects the Lagrangian conservation law to the Eulerian control volume. For example, the Lagrangian conservation law for a system of a given marked mass is that the mass is conserved and neither created or destroyed. Then $dB_{sys}/dt = dm_{sys}/dt = 0.$ Mass is not generally conserved in a control volume, say a room. When things are moved in or out of the room the mass changes. The RTT connects the two.
Mass balance
Apply the RTT to mass conservation. Assume fixed $CV$ and $CS$.
Step 1
Define $B_{sys}=m$, $\beta = B_{sys}/m = 1$. The velocity is $\vec{v}_r = \vec{v}$, that is, the fluid velocity, since that is the velocity of the system and the control volume is stationary.
Step 2
Write the conservation law. In this case $dB_{sys}/dt = 0$.
Step 3
Insert in the RTT:
$$0 = \frac{d}{dt}\int_{CV}\rho dV + \int_{CS}\rho\vec{v}dA.$$
Step 4
Apply the Gauss Divergence Theorem (GDT). The GDT is
$$\int_{CS}\vec{f}\cdot\vec{n}dA = \int_{CV}\nabla\cdot\vec{f}dV.$$
This allows conversion between surface and volume integrals. Apply to the RTT, and rearrange to give
$$\frac{d}{dt}\int_{CV}\rho dV + \int_{CV}\nabla\cdot(\rho\vec{v})dV = 0.$$
Step 5
Finally, since the CV is fixed, we can move the $d/dt$ in the first term inside the integral, but since $\rho$ is a function of position, we use a partial derivative. Then combine the two integral terms:
$$\int_{CV}\left[\frac{\partial\rho}{\partial t} + \nabla\cdot(\rho\vec{v})\right]dV = 0.$$
This holds for arbitrary control volumes only if the term in brackets itself is zero, hence
$$\frac{\partial\rho}{\partial t} + \nabla\cdot(\rho\vec{v}) = 0.$$