This is known as elimination method.
When we have two unknown variables and two equations, we make the coefficients of one unknown variable same for both the equations.
Then by addition or subtraction suitabily, we can eliminate one variable and find the value of other variable.
For instance,
here
3a - b = 12-------eqn.1
3a + 2b = 3-------eqn.2
We need to find a and b.
But we cannot find it directly.
We spot a term '3a' in the Left Hand Side(LHS) of both equations.
3a - 3a = 0
Yes, we have found a way to eliminate the variable 'a'.
But we can't just do it easily.
Everything we do in Maths has to be consistent.
So what do we do.
We subtract the whole equation 1 from equation 2. (Apparently you can also subtract eqn 2 from 1, and get the same answer in the end)
Subtracting one equation from another means subtracting the terms on the Left Hand Side of eqn.1 from LHS of eqn.2 and subtracting terms on the RHS of eqn.1 from the terms on the Right Hand Side of eqn.2
It becomes
(3a + 2b) - (3a - b) = 3 - 12
3b = - 9
b = -3
Now putting the value of b = -3 in eqn.1
3a - b = 12
3a - (-3) = 12
3a + 3 = 12
3a = 12 - 3 = 9
a = 9/3 = 3
If we try eqn.1 - eqn.2 also, we get the same answer.
Try for yourself.