The first question is actually pretty hard to answer.
Important: glass always has thickness, otherwise the light won't refract (fancy word for bend) correctly:
When you make a glass with liquid, you need to give the glass two Materials, the inside of the glass where there is liquid gets a different Material:
Duplicate the top edges of the liquid and P > Seperate by Selection. Back into Object Mode, select the new Object, go into Edit Mode and Fill it and give it a water Material:
When using Cycles, you are done:
With Eevee you need to tick some boxes for glass to work:
Global Screen Space Reflections and Refraction and also in each Material.
Now, where do all these different IOR values (how much the light bends) come from?
In CG you usually give a Material a single IOR value, but each surface has an IOR that is calculated by dividing the material's IOR by the IOR of the medium the light comes from:
This is probably a lot more than you wanted to know :)
And as a bonus, with air bubbles (IOR= IOR(air)/IOR(water)=1/1.333=0.75):
Look at all these complicated reflections and refractions and enjoy...
I do hope this was helpful in some way.