˹Remember˺ how We delivered you from the people of Pharaoh, who afflicted you with dreadful torment, slaughtering your sons and keeping your women. That was a severe test from your Lord.
And ˹remember˺ when We rescued you from the people of Pharaoh, who afflicted you with dreadful torment—killing your sons and keeping your women. That was a severe test from your Lord.
Both describe Pharaoh's oppression with the shared clause 'killing your sons and sparing your women, and in that was a great trial from your Lord'; the surrounding context differs (2:49 in a sequence of blessings, 7:141 recounting the rescue).