ATPase component of the type IV pilus (T4P) that plays a role in surface and host cell adhesion, colonization, biofilm maturation, virulence, and twitching, a form of surface-associated motility facilitated by cycles of extension, adhesion, and retraction of T4P fibers. Acts as a molecular motor to provide the energy that is required for biogenesis of the pilus and the extrusion of substrates generated in the cytoplasm (PubMed:28779124, PubMed:26965631). PilB ATPase activity is also essential for T4P extension while antagonist PilT ATPase activity is required for T4P retraction (PubMed:18223089). In addition, functions as a regulator of exopolysaccharide (EPS) downstream of the T4P filament and upstream of the Dif signaling (PubMed:28779124). Homohexamer (By similarity). Interacts with PilC (PubMed:26851283). Interacts with PilM (PubMed:26851283). Displays polar localization. The ATP-binding site is essential for assembly of pili. Deletion mutants show complete loss of T4P-dependent motility since they did not assemble T4P (PubMed:18223089, PubMed:28779124). PilB and PilT double mutant also lack T4P-dependent motility (PubMed:26965631). Belongs to the GSP E family.