For most services, this is how the AWS escalation path works:
1.) Support engineer receives the case. In most cases, for most services, the run-of-the-mill support engineer has gotten enough training on the service that they'd considered a SME at any AWS partner/enterprise.
2.) If front-line support engineer can't solve the case, they talk to their more tenured friends.
3.) If they still can't solve the case, they escalate to Premium Support SMEs in the service. These are support engineers that have proven they have solved complex enterprise-level cases and get specialized training from the service teams on the internals of the service.
4.) If the SME can't figure it out, it's escalated to the service team (i.e. the actual software engineers that write the code).
Steps 1-3 deflect a lot of the annoying, unnecessary escalations. But sometimes escalation to the teams is unavoidable. For example, some service limits are hardcoded into the service and updates require a code push. Or (somewhat rarely) there's a service bug.
That being said, Premium Support engineer have access to the backend service code for most everything. While not every PS engineer knows how to code, on more than one occasion, I've dug through a code repo to figure out why something was behaving oddly.