People code-switch when they use different languages or different versions of a single language in different social situations (or when illustrating different social situations).
Almost everyone code switches. For example, most kids don't usually speak to their close friends the same way they speak to their parents.
Code switching is particularly important for people whose home language is different from the language or language variety of the wealthy and powerful of their society.
Code switching is sometimes related to social status: the wealthy and the poor may code switch less than the middle classes (and this reinforces these distinctions).
Here's a really good (musical) summary of code switching:
By the way, "might could" is what linguists call a "double modal." Modals are words that express variations of probability and necessity. The use of "might could" emphasizes the uncertainty in the situation. Might could suggests that you have the ability to do something but it is uncertain if you will actually do it (or possibly that you are willing to do something but might or might not have the ability). So, although the cartoon might well be what the character would say in a setting where SAE is expected, a closer equivalent would be "then I asked if maybe I could borrow his."