The main insulation layer is the most important layer of the high-voltage cable, and the quality of this material directly affects the life of the cable. It is also known that contamination, porosity and associated partial discharges in the insulation can affect the service life of cables. In this paper, we use the COMSOL Multiphysics software, which is based on the finite element method in AC/DC, 2D electrostatic. Our study shows the effect of heterogeneous cavities on the functioning of electrical cables. This work contains the study of electric field distribution and potential of a model of high voltage cable; we took into account the absence and the presence of heterogeneous cavities. The study was conducted using numerical results with mathematical validation. The obtained results are considered satisfactory, favorable and very promising.