So how did they come up with that FBD to show that there is only one friction force in the direction opposite to the motion of the car?
There is not necessarily only one static friction forwards. Just the fact that there are four wheels implies more than one. But the sum of all static friction forces is what is drawn in the free-body force diagram.
And that sum must be backwards. Some local static friction forces here and there might be pointing forwards, but the total sum must be backwards. There are no other horizontal forces, so if this total static friction force wasn't directed backwards, the car wouldn't slow down - there wouldn't be a backwards acceleration (this is Newton's 2nd law).
Also, when brakes are applied, the braking pad presses against the wheels right? How does the interaction between braking pad and the wheels explain the friction between tyres and the road that they have shown in this free-body diagram?
The pads apply friction to the wheel (inside the rim). This friction force translates to a torque that slows down the wheel rotation. This slower wheel rotation now means a slower wheel-periphery speed.
A rolling wheel that isn't slipping has a wheel periphery speed exactly matching the (relative) speed of the surface. Otherwise each point on the wheel would not be standing still on the surface in the momentary moment it touches the surface. And then it wouldn't be rolling, but sliding.
Source: All That Matters Academy
With the wheel-periphery speed equaling the (relative) surface speed, all is good. But as soon as the wheel slows down, those two speeds aren't in sync anymore. The static friction force appears and slows down the car so the (relative) surface speed still matches and equals the wheel-periphery speed.
How can applying the brakes keep the car just on the verge of sliding?
As mentioned, the braking pads create a kinetic friction force on the inside rim of the wheel. When you push the braking pedal, those pads are pushed more strongly onto the rim. The kinetic friction force is:
where the normal force $n$ is the measure of how hard the pads are pressed onto the surface. When pressed harder, the rim-material must exert a larger normal force $n$ to not avoid bending or breaking, and so $n$ increases. Thus, the kinetic friction force $f_k$ increases.
And when that kinetic friction increasing, the counteracting torque due to that friction force increases. Use Newton's 2nd law in its rotational version to see that a larger coutner-torque causes a larger negative angular acceleration and thus a faster slowing down of the wheel rotation.
And thus a faster slow-down of the car itself, since a larger static friction appears at the wheel-and-ground to avoid any sliding of the wheel over the ground. The harder you press your braking pedal, the larger this static friction becomes - it is adjustable with your pedal pressure.
Remember that static friction has a limit:
The required static friction for slowing the car down so the wheel doesn't slide must be lower than this maximum limit. If you brake harder, then the static friction becomes larger, but that's no problem if you stay below this limit. The car will slow down faster as expected.
But, if you brake so much, that the static friction must increase more than what is possible for it - it must increase to above its maximum limit to cause the slowing down of the car that is required to prevent wheel sliding - then it can't do it. Then static friction gives up. Then kinetic friction between wheel and ground takes over. And this means sliding, and rubber burning.
Therefore, the most effective braking is largest possible and below this limit. In other words: The most effective braking is at the verge of this static-friction limit.
If you try to reach this limit while braking, then you might surpass it - and then you'll feel a sudden loss of traction when the static friction disappears and kinetic friction takes over.