The causes of type 1 and type 2 diabetes are completely different. Since you did not tell me which type you have, I will give a brief explanation of what is thought to cause both:
Type 1 diabetes is the most rare type. I have read that only 10 percent of all diabetics have true type 1 diabetes, although some type 2 diabetics who take insulin are sometimes wrongly called type 1 just because they take insulin. Type 1 diabetes is sometimes referred to as 'autoimmune diabetes' because the cause is a damaged immune system. I am not a medical professional, but from what I have read, I can give a simplified explanation of how it happens. The person who becomes a type 1 diabetic is born with some genes that cause the body's immune system to be damaged. At some point in life, this person's immune system goes amok when triggered by a virus (several viruses have been listed as possible trigger viruses because their protein structures are very similar to the protein structure of the insulin-producing cells in the pancreas). While attacking and killing off the virus cells, the damaged immune system proceeds to mistake the body's own pancreas' insulin-producing cells as virus and it destroys them. The person's pancreas is eventually destroyed so it cannot produce insulin. Diabetes is the result. The process can take years after the immune system first launches its attack. These people sometimes find that other endocrine glands such as thyroid are also attacked, so doctors tend to check the function of some other endocrine glands when they do regular lab work to see how these people are doing in their glucose control. Type 1 diabetics normally take insulin by injection or pump in order to survive, instead of any oral medications. The cause in this type if diabetes has nothing whatsoever to do with what they eat.
Type 2 diabetes is more of an insulin resistance problem for most type 2 diabetics. Usually, the body does produce insulin, but sometimes not enough, and at other times they produce adequate amounts, but the body doesn't utilize it properly. Often, the type 2 diabetic is overweight, for fat cells are insulin resistant, and if the person has too fat cells, the insulin they produce may just not do the job for them. For type 2 people, what they eat can definitely be a cause for high glucose levels and a diet of high-glycemic index foods can eventually cause these people to become diabetic. So for these people, the treatment is usually a very carefully regulated healthy diet with lower carbs and added exercise to help lower glucose levels. Often, the addition of oral medications that either help the pancreas to work or help the body to use the insulin that the pancreas is already producing is necessary. If the person is so insulin-resistant that the oral meds, exercise, and diet doesn't help, then insulin is sometimes added to help regulate the body's glucose levels.
I hope this helps clear up the mystery. If you do not know what kind of diabetic you are, you can ask your doctor to run lab work to determine whether there are antibodies present that indicate whether the immune system is at work on your pancreas. If oral medications are helping, then you are a type 2 diabetic, for oral medications are useless to a true type 1 diabetic.