It is so because, god Brahmā himself has ordained so.
Chapter 216 - Origin of Śrāddha, Tīrtha-māhātmya, Skanda-Purāṇa
Brahmā said:
The term Havya or Kavya was used in the Tretā Yuga. It will be used in two Yugas (viz Tretā and Dvāpara). It will not be effective in
Kali Age (Defective text).
As and when the Yugas become reduced (quantitatively and qualitatively) people will become more and more wicked with devotion
turned elsewhere.
They Will not at all offer Kavya as stipulated. Thereupon, the plight of Pitṛs will be more and more pitiable.
Hence I shall suggest an easier means of happiness in the case of embodied beings. Then, on being propitiated thereby, you will attain
great satisfaction.
& 68. O Pitṛs, all the Pitṛs upto my own self shall be extremely
delighted through what is offered devoutly to the Brāhmaṇas with the
father, grandfather and his father (i.e. great-grandfather) in view.
The same manner is to be adopted in the case of maternal grandfathers
also. There is no doubt in this matter.
& 71. When the three (preceding) generations are propitiated, all
those Pitṛs upto my own self are also propitiated. O highly esteemed
ones, even as I expatiate now, listen to the easy means conducive to
your satisfaction. With the Pitṛs in view, the descendants shall
propitiate the excellent Brāhmaṇas by means of cooked rice. With that
very cooked rice, they should offer Piṇḍas (rice-balls) unto you all.
Thereby under that name, you will have permanent satisfaction.
Hence, O ancestors, go back to your own abodes fully satisfied.
.....
On hearing those words of Parameṣṭhin and permitted by him, they resorted to their own abodes.
Ever since then Śrāddhas began to be performed on the earth with the offerings of rice-balls for upto three generations of ancestors.
English Translation by G.V. Tagare
Therefore, it's as per the directions of god Brahmā himself, that humans offer pinda, tarpanam, food etc to only to 3 generation of ancestors during Sraddha ceremony & not for 4 generations or 2 generations.
It is so, because the God himself has ordained so, as per the scriptures.