1 Introduction

The Apiaceae family includes the ancient spice plant fennel (Foeniculum vulgare Mill), which is regarded as one of the most significant medicinal herbs in the world [1]. The well-known perennial plant F. vulgare is indigenous to the Mediterranean region [2, 3]. It is utilized to prepare herbal drugs [4, 5] and is being utilized for a range of respiratory, gastrointestinal, and hepatoprotective conditions [6,7,8,9]. Research has demonstrated the diuretic, anti-inflammatory, analgesic, and antioxidant properties of herbal medicine preparations [10, 11], ACE inhibition [12], anticancer activities [13,14,15,16], and antimicrobial activities [6, 17, 18].

Essential oils (EOs) are the main constituents of fennel seeds and are being used as flavoring agents in various foods, cosmetic, and pharmaceutical products [6, 19, 20]. Estragole (methyl chavicol) was the primary chemical component of fennel seed EOs [21]. It has been observed that trans-anethole, fenchone, estragol, and α-phellandrene are the main constituents of F. vulgare seed EOs [6]. The content of trans-anethole, the main component of the EO, varied between 81.63 and 87.85% according to the maturity stage of fruits [22]. Trans-anethole, estragole, fenchone, and D-limonene were highly abundant in the EOs from fennel, with highly antimicrobial against Aspergillus flavus, Candida albicans, Bacillus cereus, and Staphylococcus aureus and antioxidant activities [23].

Mass spectrometry (MS) techniques have played a major role in the development of the natural goods industry over the last 5 years. It provided the basis for calculating out the molecular weight and recognizing the identities or structures of most natural compounds [24, 25]. Based on the electron ionization mass spectra of the molecules, the MS methods can yield a great deal of structural information with minimal investment in the molecules under study [26].

The kinetic energy of an ionized molecule is the main factor affecting its capacity to fragment [27]. Moreover, semi-empirical modified neglect of diatomic overlap (MNDO) and density functional theory (DFT) computations are the most efficient means of computing the structure of the substance and supporting the experimental study [28, 29]. These are quantum mechanical techniques that are widely used in chemistry and physics to determine the electronic structure of molecules and their thermochemical properties [30,31,32,33,34,35,36,37]. In this study, the primary constituents of fennel EOs were investigated using the DFT approach. The molecular characteristics, charge distribution, chemical activity, and other significant features of the monomeric components in an EO, i.e., from Aethionema sancakense and Phlomis bruguieri, can be inferred through DFT calculations [38,39,40,41,42,43].

Fourier-transform infrared (FTIR) spectroscopy has been used in conjunction with the GC–MS approach because of its capacity to test the quality of EOs in a timely, cost-effective, non-destructive manner [44]. The main advantage of IR is that it requires little to no-sample preparation and may be performed quickly and easily [45, 46]. Previously, mid-infrared spectroscopy was mainly used as a qualitative technique for the verification of quality indicators in distillates or extracts from plants, or for the identification of unknown pure substances by providing structural characterization based on a fingerprint spectrum and functional group vibration [47]. Due to the fact that plant extracts are multicomponent mixtures, IR spectra obtained from them are typically quite complicated [48, 49]. Band assignments may be challenging due to peak overlapping and vibrational mixing; every functional group within a single molecule adds to the overall complexity of the spectrum [50, 51].

Therefore, the main objectives of this study are to use GC–MS to determine the chemical composition of fennel essential oils and to use their electron ionization mass spectra to elucidate the molecular structure of these constituents. Furthermore, DFT and MNDO calculations were carried out, which included calculating thermodynamic parameters and optimizing geometrical forms. With the aid of the collected data and the experimental data that has been provided, it would be easier to comprehend the bioactivity of the essential oils, which would advance their usage for medicinal and bioactive purposes.

2 Materials and methods

2.1 Plant materials

Two botanical parts (leaves and umbels) from the biomass of fennel plants (Foeniculum vulgare Mill) were gathered and identified from plants growing in the nursery of the Department of Floriculture, Ornamental Horticulture, and Garden Design, Faculty of Agriculture (El-Shatby), Alexandria University, Alexandria, Egypt, in May, 2023 (Fig. 1). The plant was identified and vouchered with the number MERV. 0023.

Fig. 1
figure 1

Biomass of fennel plants and their parts used for the extraction of essential oils

2.2 Extraction of essential oils

Fresh leaves and umbels of fennel plants each of 250 g were hydro-distilled for 3 h in a Clevenger-style apparatus [38, 52]. Following its separation, anhydrous sodium sulfate (Na2SO4) was used to dry the essential oil (EO). EOs were stored at 4 °C in a refrigerator in a sealed Eppendorf tube until further analysis.

2.3 Gas chromatography–mass spectrometry analysis, computational details and FTIR spectral analysis

The EOs from fresh leaves and umbels of fennel plants were analyzed for their chemical compounds using a Facous GC-DSQ mass spectrometer (Thermo Scientific, Waltham, MA, USA) [53]. The geometry of the investigated compounds was optimized based on semi-empirical calculations using the MNDO and Polak–Ribiere conjugated gradient algorithms using the molecular modeling software Hyperchem7.5 (W.Thiel 2003, HyperChemTM, Release 7.5 Pro 200) [54].

Density functional theory (DFT/B3LYP) with 6-311G (d, p) basis set in the ground state for gas phase was used to compute the ground state electrostatic potential (ESP) of the molecule under study [55,56,57]. Gauss View 05, a molecular visualization application, and the Gaussian 09 program package were used for all of the computations [58]. The spectra investigation of the fennel EOs was recorded using attenuated-total-reflection Fourier transform infrared spectroscopy (ATR-FTIR, Shimadzu IRTracer-100 spectrometer). The IR beam enrolls in the 4000–400 cm−1 band and has an incidence angle of 30° [59].

2.4 Antifungal activity of the essential oils

Pure cultures of Alternaria solani MT279570 [60] and Fusarium oxysporum MW854649 [61] were obtained from a culture that was grown on potato dextrose agar (PDA) for 1 week. A few drops of Tween-80 (0.01%) were added to 0.01% dimethyl sulfoxide (DMSO) to dilute the EOs. To perform the agar dilution procedure, the EOs were added to the agar medium in the various amounts required. From the cultures that were still actively growing, one 5-mm culture disk of each A. solani and F. oxysporum was taken and put in the center of the Petri dishes. Next, applying the method of poisoned food technique [62], a series of twofold dilutions of the EOs ranging from 7.5 to 5000 mg/L were made and compared with the reference fungicide, chlorothalonil (0.2 mg/L). The minimum inhibitory concentrations (MICs) of the fungal growth were determined after incubating the Petri dishes at 30 °C for 7 days [63]. Only PDA medium and fungus discs were present in the controls. The growth reduction (%) of the tested two fungi was determined using the following formula: The growth reduction (%) = [(Growth in control − Growth in treatment)/Growth in control] × 100.

2.5 Statistical analysis

A two-way ANOVA analysis of variance (ANOVA) was employed to investigate the effects of the two EOs and their concentrations on the fungal inhibition growth percentages using the STATISTICA program version 8. The data were presented graphically as mean ± SD values and were considered statistically significant when p < 0.05.

3 Results and discussion

3.1 The chemical constituents of the essential oils by GC–MS analysis

The chemical components presented in the EO from the leaves of fennel plants are listed in Table 1. The abundant constituents were anethole (37.94%), estragole (35.56%), D-limonene (17.46%), trans-β-ocimene (1.53%), and fenchone (1.49%). Table 2 displays the chemical components identified in the EO from the umbels of fennel plants. Estragole (51.18%), anethole (25.08%), D-limonene (12.22%), fenchone (6.57%), and γ-terpinene (2.86%) were the primary components reported for the EO extracted from the umbels of fennel plants. Figure 2 shows the total ion chromatogram recorded by GC–MS of the EO composition of leaves (Fig. 2a) and umbels (Fig. 2b) from fennel plants. Figure 3 displays the chemical structures of the major EO components found in the leaves and umbels of the fennel plants.

Table 1 The chemical composition of fennel leaf essential oil by GC–MS analysis
Table 2 The chemical composition of fennel umbels essential oil by GC–MS analysis
Fig. 2
figure 2

Total ion chromatogram of the fennel essential oils from leaves (a) and umbels (b) using GC–MS analysis

Fig. 3
figure 3

The chemical structures of the main components with their molecular formula (M.F.) and molecular weight (M.W.) of leaves and umbels fennel essential oils

3.2 Mass fragmentations of the main compounds

As seen in Fig. 4, the 70-eV mass spectra of the main constituents of the EOs from the leaves and umbels of fennel plants are recorded and analyzed. The peak of the mass spectrum (MS) in the EOs (Fig. 4a) at retention times (RTs) of 10.95 and 10.94 min indicates the anethole component, which is explained by its molecular formula of C10H12O. The peak of the molecular ions was noted at m/z 148, with relative intensity (RI) = 100% representing the base peak, and the peak at 147 (RIn = 70%). Other significant fragment ions observed were 133 (25%), 121 (42%), 117 (30%), 105 (25%), 91 (21%), and 77 (19%).

Fig. 4
figure 4

The 70 eV mass spectra of the leaves and umbels fennel essential oil main components a anethole, b estragole, c D-limonene, and d fenchone

The MS of the peak at RTs of 8.88 and 8.83 min (Fig. 4b) represent the estragol component bringing out its chemical formula C10H12O. There was a peak for the molecular ions at m/z 148, with RI = 100% showing the base peak and a peak at 147 (RI = 68%). Other noteworthy fragment ions observed were 133 (20%), 121 (35%), 117 (38%), 105 (22%), 91 (26%), and 77 (25%).

The MS of the peak at RTs of 5.28 and 5.29 min (Fig. 4c) represents the D-limonene component (C10H16). At m/z 136, the molecular ion signal was detected with RI = 21%. The base peak was represented by further notable fragment ions, which were 121 (32%), 107 (30%), 93 (92%), 79 (48%), and 67 (100%).

The chemical formula C10H16O is suggested by the MS of the peak at RTs of 6.22 and 6.21 min (Fig. 4d), which represents the fenchone component. The molecular ion peak was observed at m/z 152 with RI = 15%. Other notable fragment ions found were 69 with RI (42%), and 81 (100%) represented the base peak.

3.3 Fragmentation pattern of anethole compound

The molecular ion C10H12O+• is obtained from the EI-MS of the anethole compound. This ion exhibited a base peak, and a molecular ion peak at m/z 148 with a high RI (100%) represents the base peak in the MS. This suggests that this particular molecule is the most stable. The first stage in the fragmentation process of the molecular ion of anethole is the production of the fragment ion at m/z 147 (Fig. 5). The loss of H from the molecular ion during the formation of the [M-H]+• ion could be the cause of this occurrence. The molecular ion fragments via three different pathways, each involving the loss of CH3 to form a different fragment ion: [M-CH3]+ at m/z 133, [M-C2H3]+ at m/z 121 due to the loss of C2H3, and [M-CH3O]+ at m/z 117 due to the loss of CH3O, are illustrated in Fig. 5. It is important to note that the estragole compound is an isomer of the molecule anethole and that the MS and primary fragmentation mechanisms of the two compounds are almost the same.

Fig. 5
figure 5

Electron ionization fragmentation pattern of anethole compound

3.4 Fragmentation pattern of D-limonene compound

The molecular ion of C10H16+• is obtained from the EI-MS of D-limonene. The molecular stability of this compound is demonstrated by the MS, which showed a base peak and a molecular ion peak at m/z 136 with RI (31%). The fragmentation process of the D-limonene compound was investigated previously in basil EO with another fragmentation shape [64], as shown in Fig. 6.

Fig. 6
figure 6

EI fragmentation pattern of the D-limonene compound

3.5 Fragmentation pattern of fenchone compound

The EI-MS of the fenchone gives the molecular ion C10H16O+•, which exhibits a base peak and a molecular ion peak at m/z 152 with RI (22%). This indicates that the molecule has normal stability. The formation of the fragment ion at m/z 81 is the initial step in the fragmentation route of the fenchone molecular ion (Fig. 7), where the production of the [C6H9]+ ion could account for this. Furthermore, it was observed that the molecular ion fragments at m/z 69 formed the fragment ion [C4H5O]+.

Fig. 7
figure 7

EI fragmentation pattern of the fenchone compound

3.6 Computational details

The optimized molecular geometry of the main components of the EOs is shown in Fig. 8.

Fig. 8
figure 8

The numbering and optimized geometry structure of the main components of the fennel essential oils

Most of the formatted heats are negative, which reflects the strong covalent bonds and lower enthalpy that characterize stable compounds relative to their elements. However, some stable compounds are found to have positive heats of formation, e.g., benzene and the condensed ring of aromatic compounds, making it unwise to generalize from this data alone. The heats of formation therefore permit a precise comparison of the stability of the compounds. The more negative the heat of formation, the greater the stability. Therefore, in the present study, fenchone and anethole compounds have the most negative heat of formation (− 39 and − 15 kcal/mol) and so they have the highest stability in comparison with the other studied molecules [65].

The thermodynamic data calculated by the MNDO semi-empirical method show that the major components have low heat of formation (∆F(M) =  − 39 and − 15 kcal/mol for the fenchone and anethole compounds, respectively), and 9.6 and 1.1 kcal/mol for estragole and limonene, respectively. This indicates that fenchone and anethole have higher stability than the other two major components reported in the fennel EOs (Table 3).

Table 3 Thermochemical data for the studied four major components of the fennel essential oils

3.7 Molecular electrostatic potential (MEP)

Figure 9 displays the molecular electrostatic potential (MEP) plots of the four compounds studied. Because of the high electron density, the areas of this molecule closest to the two oxygen atoms that are linked to the phenolic ring are the most electrophilic sites (red regions). The nucleophilic site of the molecule is shown by the blue patches that are close to the carbon atom.

Fig. 9
figure 9

Electrostatic potential (ESP) and three-dimensional MEP surface maps of the studied molecules

The molecular charge distribution is not affected by the external test charge. Although MEP is an effective technique for locating reactive sites toward positively or negatively charged reactants, it also enables the establishment of hydrogen bonding and structure–activity relationships in the molecule [66]. The dipole moment, electronegativity, and partial charges are strongly correlated with the electrostatic potential, according to quantum chemistry calculations [67]. With the help of a visual representation of the size, shape, charge density, and reactive sites of the molecules on the electrostatic potential energy surface, MEP offers a means of comprehending the relative polarity of a molecule [68, 69]. Therefore, it can be proposed a reaction mechanism wherein the oxygen atoms linked to the phenolic ring are targeted intramolecularly by a lone pair of electrons, resulting in a ring closure. The process also involves the transfer of a proton to the negatively charged oxygen atom.

The red- and yellow-colored regions (negative electrostatic potential) on the MEP surface are associated with electrophilic reactivity, while the blue-colored regions (positive electrostatic potential) of MEP are associated with nucleophilic reactivity. Looking at Fig. 9, the oxygen atoms attached to the carboxylic group in anethole, fenchone, and estragole have a negative electron density and are shown in red, while the C5, C6, C7, and C9 in D-limonene have a less negative electron density and are shown in yellow.

Actually, the molecular electrostatic potential (MESP) and the molecular electrostatic potential (MEP) are the same. The charge distributions of molecules are shown in three dimensions by electrostatic potential maps, sometimes referred to as molecular electrical potential surfaces or electrostatic potential energy maps [70, 71]. These maps give us the ability to see a molecule’s variable charge areas. Understanding the distribution of charges allows one to determine the interactions between molecules. Three-dimensional diagrams of molecules are highly helpful when it comes to electrostatic potential mapping. They make it possible for us to see the charge distributions and charge-related characteristics of molecules. They also enable us to see the dimensions and forms of molecules. Electrostatic potential maps are very useful in organic chemistry for estimating the behavior of complex compounds [72].

MEP is the net electrostatic effect generated by the total charge distribution (electron + nuclei) of a molecule at a location in space around it. It connects dipole moments, partial charges, electronegativity, and the molecule’s site of chemical action to the overall charge distribution. The colors red, blue, and green indicate the varied electrostatic potential values on the surface: red denotes the highest negative electrostatic potential, blue is the highest positive electrostatic potential, and green is the lowest potential [39].

3.8 FTIR measurement

FTIR analysis of the prepared fennel EOs helps to ascertain the possible chemical structure and identify the functional groups of the presented bioactive components [66]. The FTIR spectrum between 500 and 4000 cm−1 of diverse fennel EO was recorded, and definite wavenumbers and intensities were recorded and shown in Fig. 10.

Fig. 10
figure 10

The experimental FTIR spectra from umbels (a) and leaves (b) of the fennel essential oil

The vibrations of the OH groups, carboxyl/carbonyl C = O, C = C, and C–H bending, respectively, can be attributed to the peaks at 3400, 2905, and 2836 cm−1 in the FTIR spectra of the EOs from umbels (Fig. 10a) and leaves (Fig. 10b) of fennel plants. This shows that the phenolic, alcoholic, aromatic, and aliphatic components are present. In the FTIR spectrum of fennel oil, the peaks at 1734, 1609, 1509, and 1454 cm−1 correspond to the C = O (ketone), C = C, and aromatic ring, respectively. The presence of C–O, phenol, alcohol, epoxide, and ester as functional groups is indicated by the peaks at 1295, 1242, 1176, 1111, and 1034 cm−1, respectively. The existence of C–H and aromatic rings is indicated by the peaks at 996, 911, 814, 760, 708, 626, and 520 cm−1 [67]. All the wavenumbers and transmittances are shown in Tables S1 and S2.

3.9 Antifungal activity of the essential oils

The antifungal activity of the EOs from the leaves and umbels of fennel plants against the growth of Alternaria solani is shown in Figs. 11 and 12. Fungal growth inhibitions increased with increasing EO concentrations, whereas entire growth was detected in the control treatment, and full inhibitions were discovered in the positive control (Fig. 11).

Fig. 11
figure 11

The visual observation of the antifungal activity of the essential oils against Alternaria solani

Fig. 12
figure 12

Antifungal activity of umbels and leaf EOs against Alternaria solani at several concentrations compared to positive control (P. control)

Umbels and leaf EOs at 5000 mg/L showed the highest fungal growth inhibition against A. solani, with values of 87.78 ± 1.92% and 79.63 ± 0.64%, respectively, compared to the positive control (94.44%). Additionally, they showed fungal growth inhibition values of 68.15 ± 1.69% and 66.67 ± 0.00% at 2500 mg/L, 57.78 ± 1.11% and 56.67 ± 0.00% at 1250 mg/L, 50.74 ± 1.28% and 45.55 ± 1.115% at 600 mg/L, and 50.74 ± 1.28% and 45.55 ± 1.115% at 300 mg/L, respectively (Fig. 12).

Figures 13 and 14 demonstrate the antifungal activity of the EOs from the leaves and umbels of fennel plants against the growth of Fusarium oxysporum. The inhibition of fungal growth increased as the EO concentrations increased, while complete inhibitions were found in the positive control and complete growth was observed in the control treatment (Fig. 13).

Fig. 13
figure 13

The visual observation of the antifungal activity of the essential oils against Fusarium oxysporum

Fig. 14
figure 14

Antifungal activity of EOs from umbels and leaves of fennels against Fusarium oxysporum at several concentrations compared to positive control (P. control)

Umbels and leaf EOs at 5000 mg/L demonstrated the strongest fungal growth inhibition against F. oxysprium, with values of 77.77 ± 3.33% and 72.96 ± 1.28%, respectively, when compared to the positive control (94.44%). Furthermore, they displayed fungal growth inhibition values of 50.74 ± 1.28% and 44.81 ± 1.28% at 2500 mg/L, 46.67 ± 1.11% and 37.40 ± 2.56% at 1250 mg/L, and 37.41 ± 0.64% and 24.44 ± 2.94% at 600 mg/L, respectively (Fig. 14).

The minimum inhibitory concentrations (MIC) for the leaf EOs against A. solani and F. oxysporum growth were 15 and 30 mg/L, respectively, and for the umbel EO, they were 7.5 and 7.5 mg/L.

From the above results, fennel EOs showed the presence of some bioactive compounds such as anethole, estragole, D-limonene, and fenchone.

Several scientific and biological investigations have focused on the chemical components of fennel EOs. Accordingly, the major components of fennel EO are trans-anethole, estragole, fenchone, and D-limonene depending on the chemotype [73,74,75]. According to Telci et al. [22], trans-anethole, a phenylpropanoid, made up the majority of the EO at rates of 84.12% and 87.85% in fruits from main umbels and 81.63% and 86.76% in fruits from subsidiary umbels. In another study, trans-anethole was shown to be the primary EO component in fennel [76]. Trans-anethole and methyl chavicol are frequently the main ingredients, according to other studies on the EO compositions of various locations [77, 78], though there are different chemotypes of fennel EO that also contain l-fenchone, α-phellandrene, limonene, and α-pinene [76, 79]. Additionally, estragole, fenchone, limonene, and -pinene were present in the EO from the seeds of plants growing in Egypt in percentages of 69.78%, 13.19%, 12.43%, and 2.44%, respectively, as the major components [80].

Significant concentrations of p-cymene (17.5%) and α-pinene (13.4%) were found in the leaf EO, whereas limonene (12.9 and 9.5%) and α-phellandrene (14.6 and 8.7%, respectively) were abundant in the stem and inflorescences. The most common molecule, trans-anethole, was present in all samples in trace amounts (traces, 5.3%), whereas fenchone, which occurs often, was only found in modest amounts (3.0%–10.0%) in all samples [3]. The EOs also displayed five chemical groups, including α-phellandrene, methyl chavicol, and trans-anethole; α-pinene, limonene, and trans-anethole; α-phellandrene; and methyl chavicol and α-pinene [79]. Trans-anethole (36.7%), α-ethyl-p-methoxy-benzyl alcohol, p-anisaldehyde, carvone, 1-phenyl-penta-2,4-diyne, and fenchyl butanoate were the primary constituents of the EO extracted from the aerial parts of fennel in Tajikistan [81]. The main ingredients in the EOs recovered from the dried aerial parts of F. vulgare growing in Portugal were trans-anethole (31–36%), α-pinene, and limonene, but estragole (79–88%) dominated in the fruit EO [11]. Estragole (51.04%), limonene, L-fenchone, and trans-anethole were the main ingredients detected in the essential oil of Egyptian fennel seeds; for Chinese fennel seeds, the main components found were trans-anethole (54.26%), limonene, l-fenchone, and estragole [82].

Seed EO revealed the presence of trans-anethole (80.63%), L-fenchone, estragole, and limonene as major compounds and exhibited potential antibacterial activity [13]. Except for Salmonella sp., the EOs from dried aerial parts and fruit have shown very little antimicrobial action against Candida albicans, Saccharomyces cerevisiae, Staphylococcus aureus, Listeria monocytogenes, and Bacillus cereus [11]. Trans-anethole, fenchone, and limonene were identified as the main compounds by the EOs from completely ripened seeds from Iran, which inhibited the growth of S. epidermidis, S. aureus, P. aeruginosa, E. coli, and C. albicans [17]. Trans-anethol (69.87%), fenchone, estragole, and limonene were found to be the primary chemicals with strong action against E. coli, B. subtilis, Aspergillus niger, Fusarium solani, and Rhizopus solani in extract extracted from Pakistani fennel seeds [18].

The main compounds found in the EOs extracted from the leaves of 12 populations of F. vulgare growing wild in Tunisia were limonene and methyl chavicol, with the Zaghouan population’s EOs showing the greatest effectiveness against Micrococcus luteus and S. aureus [83]. The EOs of three Egyptian fennel cultivars cultivated organically (Foeniculum vulgare var. azoricum, F. vulgare var. dulce, and F. vulgare var. vulgare) showed the presence of trans-anethole, estragole, fenchone, and limonene as abundant compounds in all of the examined EOs. The antimicrobial activity was comparable across all three cultivars [84]. The EOs of seeds exhibited significant concentrations of (E)-anethole, methyl-chavicol, fenchone, and limonene, which had potent antibacterial effects against S. aureus, Listeria monocytogenes, P. aeruginosa, Salmonella enteritidis, and E. coli [85]. The main constituents of the EOs extracted from Moroccan wild and cultivated fennel were discovered to be estragole, anethole, and fenchone. The cultivated fennel seeds’ EO showed the highest effectiveness against Salmonella abony, P. aeruginosa, E. coli, B. cereus, Staphylococcus aureus, and B. subtilis [86].

Specifically, variations in the chemical makeup of the EOs, particularly the most prevalent components (estragole, limonene, and fenchone), were the cause of the variations in the antifungal activity of F. vulgare EO [87, 88]. Among the constituents of this EO, fenchone has shown a moderate level of antifungal activity. Penicillium funiculosum and Trichoderma viride were more susceptible to the effects of the EO, with a larger percentage of anethol and methyl chavicol (estragole) [87, 89]. The most productive fractions of F. vulgare EO were especially high in fenchone, which may have antifungal properties, and estragole [90]. The most efficient EO against gram-positive bacteria was one that was high in estragole [84], and both fenchone and limonene, which are both contained in the EO, have a positive impact on speeding up the healing, anti-inflammatory, and antimicrobial processes [91]. The effectiveness of fennel EO rich in estragole would depend on its combination with other constituents like limonene, fenchone, and trans-anetole [92]. With MIC values of 0.16–0.2–0.25 mg/mL, the EO of F. vulgare showed stronger antifungal activity, especially against C. albicans, Aspergillus niger, and A. flavus [93]. Ocimum basilicum EO, with its estragole (65.9%), showed bioactivity as a natural fungicide to manage diseases caused by F. oxysporum, R. solani, and A. solani [94].

Other studies showed that high concentrations of anethole were reported to be poisonous [95]. The secondary metabolites of EOs can freely diffuse through cytoplasmic membranes due to their lipophilic characteristics. Cell death via apoptosis and necrosis can result from this process, which can also impact membrane fluidity and permeability, transport, ion balance, and membrane potential [96, 97].

4 Conclusions

The biomass produced from fennel plants (leaves and umbels) was converted to valuable chemical products of essential oils, which bioassayed against the growth of fungi. This is the first study applying mass spectra, FTIR, and DFT calculations to the Egyptian fennel essential oil. The experimental GC–MS data revealed that the essential oil constituents from the leaves and umbels of fennel plants were anethole, estragol, D-limonene, and fenchone as the major compounds. The obtained mass spectra of these compounds upon electron ionization were verified along with their fragmentation processes. The essential oils from umbel and leaf showed potential antifungal activity against the growth of A. solani and F. oxysporum according to the reduction of fungal growth and the values of minimum inhibitory concentrations. These experimental data, in conjunction with the FTIR and DFT, provided detailed insights into the chemical behavior of the compounds under study. The theoretical studies, in combination with the experimental data obtained along with the works, may influence the understanding of some interactions and properties of natural compounds in the medical, chemical, and biological applications in the future.