You are right, the presence of high levels of ketones in the bloodstream is a common complication of diabetes.
Ketones build up when there is insufficient insulin to help fuel the body’s cells. High levels of ketones are therefore more common in people with type 1 diabetes or people with advanced type 2 diabetes.
Ketones are an acid remaining when the body burns its own fat. When the body has insufficient fuel going in, it cannot get glucose from the blood into the body's cells to use as energy and will instead begin to burn fat.
When the body is burning too much fat, it may cause ketones to become present in the bloodstream.