Type 2 diabetes can cause hyperglycemia because your insulin isn't allowing glucose to be used in your body the way it's supposed to.