I know when we say "Can you...?", it represents you have the ability to do something. But there is a situation: Amy has drunk a lot of alcohol, and she wants to go home. Bob asked her:"Can you drive?" He means if Amy can go home on her own and avoid a car accident. Is it possible?
You've got the main meaning, but let me be a bit more precise...
According to Cambridge Dictionary
to be able to
Amy may know how to drive, she has the ability to drive but she is not able at that specific moment to drive safely because she is drunk.
Also, the question does not imply that she can go home on her own. Bob and Amy may have shared the car, but it's her car, she is supposed to drive both of them home.