There are worse strategies than guessing at random. If every prisoner refused to open any boxes, the group would be guaranteed to fail. If every prisoner opened the first 5 boxes, the group would also be guaranteed to fail.
Let's look at a strategy that slightly improves over guessing at random. In this strategy, the prisoners agree beforehand that prisoners 1-5 will open boxes 1-5 and prisoners 6-10 will open boxes 6-10. Why is this strategy better? Let's take a look.
Prisoner 1 has a \( \frac{5}{10}\) chance of successfully finding their slip in the first 5 boxes. If they fail, the whole group is already dead, so we won't bother looking at that case. If they succeed, prisoner 2 has a \( \frac{4}{9}\) chance of succeeding. Why does prisoner 2 have a different chance of success than prisoner 1? The two prisoners can't communicate (other than to decide on a strategy at the start) so prisoners 1 and 2 are both going to open the same 5 boxes. If we know that prisoner 1 found their number, prisoner 2 will check the same boxes but only 4 of those boxes could contain #2. There are 9 unclaimed boxes, giving prisoner 2 a chance of \( \frac{4}{9} \).
We can continue this logic to find that the chance each of the first 5 prisoners succeeds is \( \frac{5}{10} \times \frac{4}{9} \times \frac{3}{8} \times \frac{2}{7} \times \frac{1}{6} = \frac{1}{252} \). Now here's the clincher: if the first 5 prisoners all succeed, the second 5 prisoners are guaranteed to succeed. The only way for the first 5 prisoners to succeed is if slips 1-5 are in boxes 1-5, which means that slips 6-10 have to be in boxes 6-10. The second group of prisoners agreed at the start to only open boxes 6-10, so they will all find their numbers.
The reason this strategy works better than guessing at random is that each prisoner's chance of success depends on whether the prisoners before them succeeded or failed. Either most/all of the prisoners succeed or most/all of the prisoners fail. This is going to be a crucial factor in the winning strategy.
You can use the applet below to test out different strategies. The "Reset" button will close all the boxes without changing the order of the numbers (for resetting between different prisoners). The "Reshuffle" button will reorder the slips in the boxes (for starting a new attempt with new prisoners). The "Random box" button will open a box at random for you.