Demosthenes writes:
Since the writer knew that the children of Israel wept over his body for a log time and could tell what happened after his death, how the heck do we know it was him who wrote the last of the Pentateuch and not some eulogy or obituary writer?
The belief that Moses wrote the 1st 5 books is based on tradition. After Moses' death, most probably someone else completed the last part for the sake of completeness.
Edward Elgar was a musician who died before completing his 3rd symphony. After his death, Anthony Payne completed his unfinished symphony.
It's really no big deal if someone else wrote the last chapter about Moses' death. Even in this forum, sometimes the administrators slightly edit messages for the sake of clarity.