Trees with cavities are not uncommon, some tree species develop them more readily than others. Most originate as part of a natural process, although some are inflicted upon a tree by man induced injures.
In order to evaluate the extent of a cavity, an initial visual tree survey is required, this will determine if the tree needs a more detailed inspection from these results you can decide upon the most appropriate course of action to address the cavity.
The development of decay is favoured by both the availability of aeration and a large food base. Historically partially occluded cavities were filled, it is now recognised to be poor practice (mainly due to the abrasion caused by the solid column of filler injuring the barrier zones within the tree), therefore it is no longer carried out, however the removal of soft, decayed wood and organic matter from the surface of a cavity or other decaying region of a tree, may help to reduce the supply of food to pathogens, reducing its ability to spread beyond the trees barrier zones. Cavities containing water are strongly recommended to be left alone as they are a deterrent to pathogens because the oxygen supply is not sufficient (for those trees that are vulnerable to arsine i.e. small people carrying a box a matches, some form of a deterrent should be erected).
If two or more cavities interconnect (coalesce) then there may be a need for further inspection, this may have a bearing on the structural stability of the tree, or indicate internal colonisation by pathogens.