In a nutshell
The two-pointers trick puts one marker at each end of a sorted array and walks them toward each other. Because the array is sorted, the current pair's sum tells you which way to go: too small, move the left marker to a bigger value; too large, move the right marker to a smaller one. It finds a target pair in a single pass, with none of the nested looping a brute-force search would need.