What happens under the hood is that the custom token is sent to the Firebase Auth service in exchange for an ID token and refresh token pair which are used to keep the client SDK authenticated .
Read moreWhere do I start with Firebase authentication?
Get Started with Firebase Authentication on Android
Read more