Trash compactors work by compressing the trash to reduce its volume. Due to this pressure, trash compactor bags are designed to handle these forces. This makes them much more durable than normal trash bags.
It's a classic ultralight hiker move [0] and is commonly the first suggestion in gear shakedowns on /r/ultralight.
[0] https://sectionhiker.com/how-to-keep-your-backpacking-gear-d...