Your question is answered well, for one large class of tests, on this page. As long as you can rank-order observations, you can base tests on the probabilities of different rank-orderings. The resulting tests depend only on binomial or similar statistics based on things like pair-wise comparisons, rather than the specifics of the distributions from which the samples were taken. So for comparing two sets of measurements, say group A versus group B, you can examine the probability that each particular value in A is greater than a value in B, and vice versa. If groups A and B have the same distribution, then neither group should dominate the other. That's the basis of the Mann-Whitney test discussed on the page linked above.
Another approach is to accept the samples that you have as the best available estimates of the underlying distributions and to resample repeatedly (with replacement) to see how frequently, say, the mean of a new sample from group A exceeds that of a new sample from group B among hundreds to thousands of resamples. That's bootstrapping, frequently discussed on this site.