That's just normal flash memory degradation when you are using low quality chips. It's very common, especially among low end Samsungs. It's not something that can be fixed on the software side.
It was really very rapid in the Nexus 7 for me, though. I think my iPad Air 2 has it to an extent now, say, but it’s _9 years old_; it is somewhat understandable. My 2012 Nexus 7 was starting to behave very badly a year in.
Were you doing any rooting, flashing of custom roms, large i/o operations like video stuff or similar? The average flash memory chip quality of that era (depending on the supplier) wasn’t great, they can’t handle as much read-write cycles as typical modern consumer silicon.