Check the picture below.
so the cars are 276 miles apart, let's say the southbound car is going "r" mph fast, that means the northbound car is going "r + 12" mph fast as you see in the picture, so at some time they meet, hmmm wait, we know they're 3 hours apart from passing each other, so that means by the time they meet, 3 hours have passed, so by the time that happens, the northbound car has been traveling for 3 hours and the southbound car has been traveling for 3 hours as well.
Since we know they're 276 miles apart, let's say by the time they meet the southbound car has covered "d" miles, so the northbound car has covered the slack then, that is "276 - d" miles.
![{\Large \begin{array}{llll} \underset{distance}{d}=\underset{rate}{r} \stackrel{time}{t} \end{array}} \\\\[-0.35em] ~\dotfill\\\\ \begin{array}{lcccl} &\stackrel{miles}{distance}&\stackrel{mph}{rate}&\stackrel{hours}{time}\\ \cline{2-4}&\\ Southbound&d&r&3\\ Northbound&276-d&r+12&3 \end{array}\hspace{5em} \begin{cases} d=(r)(3)\\\\ 276-d=(r+12)(3) \end{cases} \\\\[-0.35em] ~\dotfill](https://img.qammunity.org/2024/formulas/mathematics/high-school/1msoo884f05uuvxv3phh532z69bffupupi.png)
