A Muggle was a human who were incapable of using magic because they didn't have any magic in their genes. They didn't know about the wizarding world and were unaware of anything magic in their separated world, unless they married a witch or wizard and/or they had a child who had magic.
They shouldn't be confused for a Squib, who was born to magical parents but their magic gene was dormant. They usually joined the Muggle world, and their dormant gene eventually surfaced again in a descendant who would be a Muggle-born.
Witches and wizards have a gene which caused changes in their physiology. Muggles have a shorter life span, and could be susceptible to injuries and illnesses which the wizarding world can easily solve.
Because they don't have any magic abilities, they had to devise other ways to function and develop technology. They invented electricity which they used for power, but electricity doesn't work properly in the wizarding world. Witches and wizards don't tend to understand their technology and have to adapt their technology including radios and cars to work using magic instead. Such technology was known to include battery controlled toys, planes, telephone, television, radio and video gaming.
In earlier years, the Muggle and wizarding worlds knew of each other and lived in peace. But soon, Muggles began to fear their ability to do what they couldn't and thought magic was evil. They began trying to kill witches and wizards in the Middle Ages. Any friendly relations were eventually broken, leading to a wizarding consensus to conceal their world.
In 1692, the International Statute of Secrecy was enacted. The wizarding world hid using Muggle Repelling Charms, and kept track of what Muggles had seen and gained knowledge of so they could erase their minds. Any violations of the Statue was handled by the Improper Use of Magic Office, and bewitched objects were taken and kept away by the Misuse of Muggle Artefacts Office. A Muggle Liaison Office was found in the Department of Magical Accidents and Catastrophes, and a Muggle Relations office was established.
Muggles tended to be very oblivious to anything magic even if it happened in front of their own eyes. They found their own, logical reasons for why strange things happened, and couldn't even pay enough attention to notice any wizarding establishments and towns, even if they had been hidden in one of their own towns. If they do happen to notice anything, action was taken to intervene. Witches and wizards proposed why they chose to accept magic was impossible, including the book, The Philosophy of the Mundane: Why the Muggles Prefer Not to Know.
Muggles had very limited chances to get a view of the wizarding world because they didn't get to know about it unless they had special permission to. They usually had family who were witches and wizards, including a spouse and/or a child who could be a Muggle-born or half-blood. They could instead be involved in a high government position which needed their knowledge and wizarding attention.
The family of a Muggle-born found out when their child was eleven, and had been known to be supportive of their ability and need to join the wizarding world. They could take their child to wizarding places usually concealed, so it's unknown how they were able to see those places, and they could see photographs of those places including ones of Hogwarts School.
A sibling of a Muggle-born would know too, but they could find it difficult to accept if they didn't have magic too, e.g. Petunia Dursley. She thought her sister, Lily Potter was a freak because she was jealous. Her husband, Vernon Dursley happened to find the wizarding world a freak show too because he wanted things to be "normal", and chose to be ignorant and distrustful.
In cases of dating and marriage, it's unknown when and how a Muggle could get permission to know. It could be a shock to find out their spouse was a witch or wizard, which was the case for Mr Finnigan. Tom Riddle thought his father, Tom Riddle Snr. abandoned Merope Gaunt just because she a witch. However, he had been drugged by a Love Potion and didn't ever love her, so he was probably in shock.
They have been known to be both afraid of magic, and to try and use it for their own gain. Ariana Dumbledore was attacked when Muggles saw her using magic and wanted her to do it again, which she failed.
The wizarding world was generally unconcerned about the Muggle world and focused on their own world. A few took an interest and pursued studying Muggles in subjects including Muggle Studies, and wrote books about their studies. An Institute of Muggle Studies was established too. Arthur Weasley was very curious about how they functioned even though he got things wrong, and collected objects including batteries and electric plugs.
Witches and wizards could later pursue jobs where they liaised and helped protect the Muggle world against the Dark Arts and anything potentially dangerous including bewitched objects.Their goal was to uphold the Statute of Secrecy.  These witches and wizards had very favourable views of the Muggle world, who they did in fact share certain things with. Professor Dumbledore was known to be very fond of sherbet and ten-pin bowling.
However, other witches and wizards had negative opinions about the Muggle world. They thought they were superior and even viewed Muggle-borns to be inferior. They have engaged in Muggle-baiting, where they try to confuse and upset Muggles by purposely using magic without their knowledge. A known way of doing that was to use shrinking keys. A witch once proposed to legalise hunting non-magic people.
Strong supporters of blood purity and superiority thought marrying a non-magic person was unacceptable. They didn't want to dilute their magic blood and thought Muggle-borns were weak, and unworthy of studying magic and being involved in the wizarding world. Anyone who didn't value their pure-blood were labelled "blood traitors", and any known supporters of Muggle protection or anyone who had a favourable view were looked at in disdain. People have been known to try to sabotage any laws done in their favour.
A few Dark witches and wizards including Gellert Grindelwald and Tom Riddle worked to try and control the wizarding and Muggle worlds so they were subservient to the wizarding world. Riddle and the Death Eaters caused and fought in the First and Second Wizarding Wars to gain control. They killed Muggles and shunned and punished Muggle-borns when they took control of the Ministry of Magic.
Notes and sources
- Harry Potter and the Prisoner of Azkaban, Chapter 1
- Harry Potter and the Deathly Hallows, Chapter 16
- Harry Potter and the Philosopher's Stone, Chapter 14
- Harry Potter and the Chamber of Secrets, Chapter 3
- Harry Potter and the Chamber of Secrets, Chapter 2
- Harry Potter and the Order of the Phoenix, Chapter 29
- Harry Potter and the Philosopher's Stone, Chapter 1
- Harry Potter and the Prisoner of Azkaban, Chapter 3
- Harry Potter and the Order of the Phoenix, Chapter 4
- Fantastic Beasts and Where to Find Them: An A-Z of Fantastic Beasts
- Fantastic Beasts and Where to Find Them: Introduction (Magical Beasts in Hiding)
- Harry Potter and the Half-Blood Prince, Chapter 1
- Harry Potter and the Chamber of Secrets, Chapter 4
- Harry Potter and the Chamber of Secrets, Chapter 6
- Harry Potter and the Deathly Hallows, Chapter 33
- Harry Potter and the Philosopher's Stone, Chapter 4
- Harry Potter and the Philosopher's Stone, Chapter 7
- Harry Potter and the Chamber of Secrets, Chapter 17
- Harry Potter and the Half-Blood Prince, Chapter 13
- Harry Potter and the Deathly Hallows, Chapter 28
- Harry Potter and the Chamber of Secrets, Chapter 14
- Archived information from the old version of JKRowling.com: W.O.M.B.A.T. test (Grade 3)
- Harry Potter and the Goblet of Fire, Chapter 4
- Harry Potter and the Philosopher's Stone, Chapter 6
- Harry Potter and the Order of the Phoenix, Chapter 6
- Harry Potter and the Chamber of Secrets, Chapter 9
- Harry Potter and the Chamber of Secrets, Chapter 18
- Harry Potter and the Deathly Hallows, Chapter 18
- Harry Potter and the Deathly Hallows, Chapter 1
- Harry Potter and the Deathly Hallows, Chapter 13