Recently, I came to know that a boy in my town who is 6 years old is diabetic and many people were shocked from this news.
Type 1 diabetes is commonly diagnosed in children; type 2 diabetes is more common overall and is much less likely to be diagnosed in children, though possible.
Type 1 diabetes is caused by damage to the pancreas and depends on environmental and genetic causes, most often leading to autoimmune loss of the insulin-producing beta cells in the pancreas. Type 1 diabetes occurs because insulin levels themselves are low. It commonly begins in childhood, and is also sometimes referred to as "juvenile diabetes" although it lasts life-long. Type 1 diabetics often take insulin to replace the insulin they are not producing.
Type 2 diabetes, by contrast, is caused by reduced insulin sensitivity and develops over time (lack of insulin can also eventually occur). Obesity and other lifestyle factors are strong influences on the development of type 2 diabetes, though genetics can also play a role. Type 2 diabetes is most often diagnosed in adults (and is also referred to as adult-onset diabetes, though it is also possible to occur in children), increases with age, and is overall more prevalent than type 1 diabetes, so this is likely where your community's surprise comes from.