Firstly, good questions! Many people (in my experience) just learning trig don't actually understand what the trig functions are, so well done for asking!
Firstly, you need to understand similarity of shapes. More specifically, when talking about right triangles, if I keep all angles in the triangle the same but I change the length of one the sides by some factor, then all the sides of the triangle will be changed by that factor.
For example, if I had a right angled triangle with side lengths $a,b$ and $c$, then if I doubled the length of the side that was $a$ to $2a$ then all the other lengths of the triangle will also be doubled. This is where trigonometric functions come in.
Consider a right angles triangle containing an angle A, as shown in the image below.

We define the (basic) trigonometric functions as follows:
$$\sin A=\frac{a}{c}=\frac{\text{Opposite}}{\text{Hypotenuse}}$$
$$\cos A=\frac{b}{c}=\frac{\text{Adjacent}}{\text{Hypotenuse}}$$
$$\tan A=\frac{a}{b}=\frac{\text{Opposite}}{\text{Adjacent}}$$
So in fact the trigonometric functions for a given angle give us the ratio of any two relevant sides of this right angled triangle. Note that because of similarity as discussed before this ratio is constant however large this right angled triangle is, as long as the angles are kept constant.
This definition cannot be extended to angles larger than $90$ degrees (or negative ones for that matter); if you want I could do this for you but it is more complicated.
As for your second question about how the calculator 'knows' what values these trigonometric functions have for a given angle, I'm afraid you'll need to wait until you learn some calculus in order to be able to understand how we can approximate values of trig functions. (We can use Maclaurin series if you know what that is; if not don't worry.)
I hope I have helped you. Please feel free to ask anything that may still be bothering you.