1 teaspoon freshly squeezed lemon juice, plus more as needed
Heat a large frying pan with a tightfitting lid over medium heat until hot, about 3 minutes. Add 2 tablespoons of the butter and swirl to melt and coat the pan. Add the onions or shallots, 1/2 teaspoon of the salt, and the pepper and cook, stirring occasionally, until the onions are softened, about 4 to 5 minutes. Add the ham and cook, stirring occasionally, until some fat renders, about 3 minutes.
Increase the heat to high, add the peas, water, and remaining 1/2 teaspoon salt, and stir to combine. Cook, covered, stirring every few minutes, until the peas are just cooked through, about 6 minutes.
Remove from heat, add the remaining 2 tablespoons butter, lemon zest, and lemon juice, and stir to combine. Taste and season with additional salt, pepper, or lemon juice as needed.