The simplest explanation is that in Middle English the unstressed forms "ye" (subject) and "you" (object) were both pronounced the same, /jə/. This led to confusion as to how they should be used, and ultimately elimination of one form.
More specifically, we can see in written sources that there was a sporadic confusion between "you" and "ye" in the 14th and 15th century, and subsequent confusion that in some cases led to regular use of "you" used as subject and "ye" as object, as well as authors using both without a clear distinction.
The OED says (under you):
Originally the accusative and dative plural of the second personal pronoun ... There have been two major changes in the use of you pron.:
(i) Use as a plural subject form, in place of ye pron. This process apparently began in the 14th cent., and you pron. became the dominant form in this function by at least the end of the 16th cent. in most written language. It has long been the invariable form as both subject and object form in almost all contexts in the modern standard language.
(ii) Use as a singular form, originally as an object form and later also as a subject form.
Use of you as a plural subject form, and conversely of ye as a plural object form, appears to date from the 14th and 15th centuries respectively, occurring at first rather sporadically ... This may partly have arisen from homophony of unstressed forms of each pronoun (see above on forms), and hence reanalysis. In some early instances you may have been exploited as a more distinctive form in contexts where inversion of usual word order occurred, but the precise circumstances are unclear.
There are other related questions but often the answers are not particularly thorough. But see Why are both "ye" and "you" used as subjects in Anne Bradstreet's To My Dear and Loving Husband?
This is very common across languages, especially in less commonly used plural forms, and it varies which are merged: French has nous/nous (we/us) and vous/vous (you/you) but ils/les (they/them), while German has wir/uns (we/us), ihr/euch (you/you), but sie/sie (they/them). (Russian has more cases but there are still a few duplicates, although some languages have preserved distinctions in all cases.)
Reference: "you, pron., adj., and n.". OED Online. June 2022. Oxford University Press. (accessed July 18, 2022).