Preheat oven to 400°F Coat an 8-inch-square baking dish with cooking spray.
Place bacon (if using) in a large Dutch oven. Cook over medium heat, stirring often, until crispy, 4 to 6 minutes. Remove with a slotted spoon to a paper towel-lined plate to drain. Pour off the bacon fat.
Return the pot to medium-low heat; add oil, onion, and garlic and cook, stirring often, until fragrant and starting to brown in spots, 2 to 8 minutes (cooking time will be quicker if you started with bacon). Add 1 cup broth and salt; bring to a boil over high heat. Add collards (or kale); stir until wilted down to about one-third the volume and bright green, 1 to 2 minutes. Cover, reduce heat to medium-low, and simmer, stirring occasionally, until tender, 18 to 20 minutes. Adjust heat during cooking to maintain a simmer, and add water, 1/4 cup at a time, if the pan seems dry.
Meanwhile, bring 2 cups water and the remaining 1 cup broth to a boil in a large saucepan. Pour in grits in a steady stream, whisking constantly. Bring to a simmer, whisking constantly. Reduce heat to medium-low and cook, whisking often, until thick, about 5 minutes. Combine 1/2 cup cheese, salsa, and egg in a small bowl. Remove the grits from the heat and quickly stir in the cheese mixture until combined.
Working quickly, spread about half the grits in the prepared baking dish. Top with greens, spreading evenly. Spread the remaining grits over the greens. Sprinkle with the remaining 1/4 cup cheese and the reserved bacon (if using).
Bake the casserole until hot and bubbling, about 20 minutes. Let stand for about 10 minutes before serving.