Microgrids (MGs) are capable of playing an important role in the future of intelligent energy systems. This can be achieved by allowing the effective and seamless integration of distributed energy resources (DERs) loads, besides energy-storage systems (ESS) in the local area, so they are gaining attraction worldwide. In this regard, a DC MG is an economical, flexible, and dependable solution requiring a trustworthy control structure such as a hierarchical control strategy to be appropriately coordinated and used to electrify remote areas. Two control layers are involved in the hierarchy control strategy, including local- and global-control levels. However, this research focuses mainly on the issues of DC MG’s local control layer under various load interruptions and power-production fluctuations, including inaccurate power-sharing among sources and unregulated DC-bus voltage of the microgrid, along with a high ripple of battery current. Therefore, this work suggests developing local control levels for the DC MG based on the hybrid particle swarm optimization/grey wolf optimizer (HPSO–GWO) algorithm to address these problems. The key results of the simulation studies reveal that the proposed control scheme has achieved significant improvement in terms of voltage adjustment and power distribution between photovoltaic (PV) and battery technologies accompanied by a supercapacitor, in comparison to the existing control scheme. Moreover, the settling time and overshoot/undershoot are minimized despite the tremendous load and generation variations, which proves the proposed method’s efficiency.