Melt butter over medium heat in a 6 quart Dutch oven or soup pot. Add onion and cook for 3 to 4 minutes (or until softened) while stirring frequently. Add garlic and cook for an additional 30 seconds, stirring constantly.
Slowly add flour (about a tablespoon at a time), while constantly stirring. Once all of the flour is added, slowly pour in milk while continuing to stir. Cook for 1 minute while stirring or whisking to smooth out any lumps.
Slowly pour in chicken broth and stir to combine.
Add potatoes, carrots, and bay leaf. Stir to combine.
Increase heat to medium high and bring to a simmer (while stirring occasionally). Reduce heat to maintain a simmer and simmer for 15 minutes (uncovered, stirring occasionally), or until potatoes and carrots are tender.
Stir in ham and peas. Cook (while stirring occasionally) until heated through (about 1 to 2 minutes).
Remove from heat and add cheese (a handful at a time) while stirring until cheese is melted and smooth. Season with salt and pepper. Remove and discard bay leaf before serving.