XRF (x-ray fluorescence) is an x-ray optical analysis technique which is based on spectroscopic detection of fluorescence of atoms which are excited by x-rays. It is an elemental analysis technique which is able to tell you the concentration of different elements in a sample. Thus this technique is able to differentiate between atoms having different atomic numbers.
https://en.wikipedia.org/wiki/X-ray_fluorescence
ICP-MS (Inductively coupled plasma mass spectrometry) is an elemental analysis technique which is based on mass spectrometry. In contrast to XRF the ICP-MS is able differentiate between atoms having different atomic mass; thus here you can distinguish between different isotopes of an element.
XRF is a non destructive method which can use an energy dispersive x-ray fluorescence (ED-XRF) or wavelength dispersive x-ray fluorescence (WD-XRF) technologies. The latter uses an x-ray source which emits x-ray beams on the samples, and the scattered rays pass through 2 collimators with a diffraction device (DD) to end up in the detector. The former (ED-XRF) does not utilize DD. The detector measures the florescence wavelength/energy of the elements to calculate the concentration in a sample. But this needs a really hard work to build a calibration prior to use your xrf. The calibration is built using a mixture of usually used samples or similar (it depends your speciality) in your lab in which a library of different concentrations vs intensities of a set of standard reference material is recorded. It may happen that you use different calibrations to process/measure different sets of samples. Some elements cannot be detected by ICPs but often are subject to be analysed exclusively by XRF such as S, As, Br, Cl. the final results in general is the energy spectra converted into concentration of each chosen element in your calibration. Accuracy and precision depend closely on the strength of the calibration used during analysis. Major elements concentration are generally measured in mass% while trace/REE in ppm
Regarding ICP-MS, it is a destructive method which implies fusion of the sample using lithium metaborate flux with dilute nitric acid. It is based on mass spectrometry concept. This method implies also the use of trace and REE elemental standards that you select for final results. Machine drift, detection limit, accuracy and precision, in this case, depend on the standard preparations, matrix, fusion, digestion, final volume, dilution folds etc.. It is not common to measure majors in ICP-MS as generally they are subject to be analysed using ICP-OES (optical emission spectroscopy).
Both techniques are different from a technological point of view but simultaneously also are very similar in the final consequences and applications of both technologies, that is, the atomic quantitative analysis of the elemental composition of any kind of material or matrix.
Inductively coupled plasma mass spectrometry (ICP-MS) is an analytical technique used to measure elements at trace levels in biological fluids. It is destructive technique.
Where as XRF (X-ray fluorescence) is a non-destructive analytical technique used to determine the elemental composition of materials.