Reverse osmosis is the process of applying pressure to water on one side of a membrane to force it back through the membrane while the membrane removes molecules that are not wanted and the cleaned water can then be distributed as drinking water. This method can be used to purify salt water or water contaminated with other unwanted toxins or chemicals and the process can be managed by very small devices and is often the best way of purifying water for people on the move.
In terms of it being preferred over distillation for a remote coastal town, the fact that there is a plentiful source of water (the ocean) nearby is a big factor in its efficiency. The possible costs of transporting water to this remote town would be very high and so the slightly higher cost of reverse osmosis when compared to distillation of water from some other source might be justified. When coupled with another purification method to remove anything that might pass through the membrane or the seals around it, it can be very effective in producing clean water.