If a spell has verbal and/or somatic components, are they absolutely vital for its casting?
Let me give a clear example: suppose a wizard is trying to cast Detect Magic on a creature they are speaking to, but they don't want the creature to notice the spell is being cast. Detect Magic has both verbal and somatic components, so the wizard might comply with the somatic portion by just forcefully gesticulating as one would in an energetic conversation. But they might not be able to actually speak out the proper incantations.
Another situation: a sorcerer has both her hands tied behind her back and is trying to cast Acid Splash. She can't perform the somatic portion of the spell, but she can easily speak out the incantations.
In these situations, can the spells simply not be cast? Or can the spells still be cast, but with some kind of penalties added? And if the answer is the latter, which penalties should I consider?
You must be able to provide all components.
This is the rule from the Spellcasting > Casting a Spell > Components section of the Basic Rules or Player's Handbook, emphasis mine:
You explicitly must be able to provide all components to be able to cast a spell. (The exception would be if you have a feature that allows you to ignore a component. In your example, the tied-up sorcerer might be able to use Subtle Spell metamagic to ignore the components they can't provide due to the bindings, but that's not the general rule.)