The ScrumMaster's job is about more than just enforcing the process within the team, or even among the stakeholders. The ScrumMaster's biggest job is to make sure the process is working well for all involved. The team could have mastered the Scrum process, and both they and the stakeholders/product owner could be totally invested in the process and committed to making it work, and it can still fail. It's the ScrumMaster's job to avoid this possibility, whenever and wherever any problems that could derail it may arise.
One of the biggest aspects of that general role, therefore, is roadblock removal. When the team identifies a point beyond which they cannot proceed without something changing, it's the ScrumMaster's job to ensure the required change happens far enough in advance of it being an actual block on productivity that said productivity isn't affected. This change could be anything; in my experience it's usually some matter of a cap-ex, a needed hire, or other expenditure of money above the basic team cost, that everyone probably knew they'd need eventually, but didn't want to cut the check for until they absolutely had to.
It's the ScrumMaster's job in those situations to get that check cut sooner than later, and to make sure whatever's being paid for is accessible to the team ASAP, so that the team doesn't actually hit the roadblock and have to hit the brakes. Failing that, the ScrumMaster is responsible for finding a "detour"; a way through the critical path of the project that requires the least deviation from the timeline, along which the team can proceed at least for a while longer until the roadblock is cleared and the team can pick up the blocked stories.
These things happen even to the most well-oiled, highly-skilled Agile teams; that team doesn't usually have the authority to hire people, they don't cut checks for hardware stacks or cloud contracts. They certainly don't spend their days on the phone with U.S. customs to make sure the hardware security module procured in the US, that has to be in place over in Belarus by D-day or the entire system can't come online on-schedule, isn't going to be held at the port any longer than it absolutely has to while they make sure it's not subject to ITAR. As a non-specific, hypothetical example.
Very often, even the ScrumMaster doesn't have those powers. But, he has the people who do have such authority or contacts on speed dial (and if he doesn't his time is spent identifying those people and their direct lines of communication), and it's his job to make sure all the necessary people are coordinating effectively to clear the roadblock before it actually impedes team productivity.
That's no small job, usually because the ScrumMaster has very little power to make things happen himself. His primary tool is finding the proper motivation for those with the requisite authority. For check-cutting people, his main point of contact is usually the product owner and his own PM, and the motivation is simple; spend the money now, or else every day after today that you don't, 6 guys will be sitting on their thumbs at your expense on top of the money you don't want to spend. For hiring, it's usually more internal (unless the salary requires dipping into contract slack), and the motivation is similar; hire one guy with the specialized knowledge we need to negotiate this big unknown in the system architecture, or waste six dev-days on contract every day you don't.
For unrelated third parties, it gets harder, because the guy at Norfolk or Houston, that has to sign your papers before your cargo container goes on a ship, couldn't possibly care less how much his failure to do so will cost your firm and your client. The ScrumMaster in these cases usually has to find some alternate motivation, or alternately find someone who knows that alternate motivation. Could be a personal friendly relationship with the customs agent themselves, where a little schmoozing gets the paperwork bumped up to the top priority. Could be a personal friendly relationship with your Senator, who has a personal friendly relationship with the House Rep of that port's district, who has a friendly personal relationship with union leaders and/or port authority management that can issue the appropriate Word From On High.
Anyway, back to the question, this is the ScrumMaster's overall job; not only to make sure the invested parties in the project follow Agile, but to make sure Agile works for those parties, even when rubbing up against un-Agile forces of the real world. For a well-oiled team with committed stakeholders, most of the ScrumMaster's job will involve the real world, which is honestly a much bigger and harder part of the job than getting the team to do what they're supposed to in the process.