I believe what you are holding is the "D" seal. They just snap into a channel but they won't stay if there's any stress/bend/deflection in the material. I reluctantly glued mine in place after unsuccessfully snapping the top of my living slide back in twice only to have it come back off. You can also buy new material.
If it's the face of the "D" seal torn away, you need to replace.
Pretty sure they are important sealing the slide to the motorhome when closed.
2015 FR3 30DS
2010 Ford Escape Toad -or- 2012 Ford Focus Toad