In a large pot of salted water, boil potatoes until fork tender; remove from heat; drain; mash well without adding butter or cream; place in large bowl; set aside.
Place the all-purpose flour in a large plate; set aside.
Allow potatoes to cool to room temperature or colder; warm potatoes make the cakes more difficult to form.
In a small pan, over medium heat, add olive oil and sauté the garlic and onions until translucent.
To the bowl with all the potatoes, add the ham and cheese.
Form onto 8 equal sized balls and pat them to about 1-inch thickness.
Dip the cakes in flour to coat; place them on a parchment paper covered plate or tray.
Cover the bottom of a cast iron or non-stick frying pan with canola oil.
Heat on medium for a few minutes before adding the cakes a few at a time; do not crowd the pan or it will make it more difficult to keep the cakes intact.
Let the cakes brown very well on one side before gently flipping them over to brown, for an equal amount of time, on the other side; 4 to 5 minutes should do it but the browner the better and the easier they will be to flip.
When cooked, transfer to a cookie sheet.
If making multiple batches, hold in a 200°F oven, or warming oven, until all of the cakes are fried and ready to be served.