Gurobi and CPLEX use (very sophisticated) variants of the branch-and-bound algorithm.
In Mixed Integer Programs, there can be both continuous and integer variables. It turns out that the integer variables are the complicating factor: without integer variables, what remains is a Linear Program (LP). LPs are always convex, which implies that every local optimum is a global optimum. Hence, you can never get stuck in a local minimum when solving an LP.
As an example, assume that we have a single complicating integer variable $x$ that is allowed to take values between 1 and 3, that is $x\in \{1,2,3\}$. I will explain how branching can be used to deal with this integer variable (more on bounding later).
First, we ignore the integer requirement, and instead we use $1 \le x \le 3$. We call this the linear programming relaxation. And for good reason! There are no more integer variables, so we are left with an LP that is easy to solve. We solve the LP, and we find that $x = 2.5$ in the current solution.
However, we have not solved the original problem, as $x = 2.5$ is not integer. To continue, we branch. That is, we split the problem in two. Problem 1 requires that $x \in \{1,2\}$ while Problem 2 requires that $x = 3$. Obviously, one of the two contains the optimal solution to the MIP.
In Problem 1, we get the relaxation $1 \le x \le 2$. If we are lucky, solving the LP will give either $x=1$ or $x=2$. If this is not the case, we will branch again into $x=1$ or $x=2$, resulting in Problem 3 and Problem 4. If Problem 2 is feasible, we get a solution with $x=3$. If we have performed all the necessary splits, for all variables, we can compare all MIP solutions that we have obtained, and pick the best one.
Because of how we split the problem, a global optimum is guaranteed to be found. We cannot get stuck in a local optimum: if the integer variables do not yet have integer values, we branch, and if all integer variables have integer values, the remaining LP cannot get stuck.
Then for the bounding part of branch-and-bound. By calculating bounds on the objective value for each of the subproblems, we are often able to tell that a subproblem does not contain a global optimum. In that case, we do not have to branch further, and we can focus on the other subproblems. Bounding is extremely important in practice