Chemistry (11th Grade)

What is the principle behind the octet rule?

Atoms tend to gain, lose, or share electrons to achieve a full outer shell of eight electrons.