Endophytic bacteria are plant-beneficial bacteria with a broad host range. They provide numerous benefits to their hosts, helping them tolerate several biotic and abiotic stresses. An interest has recently been developed in endophytic bacteria which are producing bioactive compounds that contribute to the biological control of various phytopathogens. This research paper aimed to investigate the potentiality of new local strains of endophytic bacteria such as Bacillus amyloliquefaciens and B. velezensis and the production of several antimicrobial metabolites associated with the biocontrol of Alternaria sp., which cause serious diseases and affect important vegetable crops in Egypt. Twenty-five endophytic bacteria isolates were obtained from different plants cultivated in El-Sharkia Governorate, Egypt. Dual culture technique was used to evaluate the bacterial isolates’ antagonistic potentiality against Alternaria sp. and Helminthosporium sp. The most active bacterial isolates obtained were selected for further screening. The antifungal activity of the most active endophytic bacterial isolate was assessed in vivo on pepper seedlings as a biocontrol agent against Alternaria sp. A significant antifungal activity was recorded with isolates C1 and T5 against Alternaria sp. and Helminthosporium sp. The bacterial endophyte discs of C1 and T5 showed the highest inhibitory effect against Alternaria sp. at 4.7 and 3.1 cm, respectively, and Helminthosporium sp. at 3.9 and 4.0 cm, respectively. The most active endophytic isolates C1 and T5 were identified and the 16S rRNA sequence was submitted to the NCBI GenBank database with accession numbers: MZ945930 and MZ945929 for Bacillus amyloliquefaciens and Bacillus velezensis, respectively. The deformity of pathogenic fungal mycelia of Alternaria sp. and Helminthosporium sp. was studied under the biotic stress of bacteria. The culture filtrates of B. amyloliquefaciens and B. velezensis were extracted with different solvents, and the results indicated that hexane was the most efficient. Gas Chromatography-Mass Spectrometry revealed that Bis (2-ethylhexyl) phthalate, Bis (2-ethylhexyl) ester, and N,N-Dimethyldodecylamine were major constituents of the endophytic crude extracts obtained from B. amyloliquefaciens and B. velezensis. The in vivo results showed that Alternaria sp. infection caused the highest disease incidence, leading to a high reduction in plant height and in the fresh and dry weights of pepper plants. With B. amyloliquefaciens application, DI significantly diminished compared to Alternaria sp. infected pepper plants, resulting in an increase in their morphological parameters. Our findings allow for a reduction of chemical pesticide use and the control of some important plant diseases.