Sapphire is the base PHP Framework. SilverStripe (the CMS) is written ontop of Sapphire. All your code will use Sapphire and some from SilverStripe if you need to use the CMS (eg Pages, adding Fields to the CMS).
As for your code, you shouldn't need to worry about what you are using. All your PHP code should be in mysite/code/* and things like database querys will need to use the class's and methods sapphire provides.
Sapphire provides alot of the user login and validation for you out of the box for you.