the ionic bond
Some atoms bond by an outright transfer: one hands an electron over, the other takes it, and the two resulting opposite charges cling together like a fridge magnet on a fridge. That electrostatic grip between a positive and a negative ion is the ionic bond. It is the bond of salts and many ceramics; think of common table salt, sodium chloride, as the textbook example.
It happens between atoms of very different electronegativity, usually a metal (eager to give electrons away) and a non-metal (eager to take them). Sodium hands its single outer electron to chlorine; sodium becomes Na^+, chlorine becomes Cl^-, and the opposite charges attract. Crucially, this attraction is non-directional; a charge pulls equally in all directions, like the field around a tiny ball. So each ion simply surrounds itself with as many oppositely-charged neighbours as will fit, packing to balance charge and size rather than to point in any particular direction. In salt that means every Na^+ is hugged by 6 Cl^- and vice versa.
Because the bond has no preferred direction, ionic solids pack densely and symmetrically, and their structure is set by size (the radius ratio) and by keeping the whole crystal charge-neutral. The strong electrostatic hold makes them typically hard, brittle, and high-melting; because the electrons are locked onto individual ions, they do not conduct electricity as solids (no free charges to move), yet melt them or dissolve them in water, freeing the ions, and they conduct well. Their brittleness has a lovely cause: shove one layer so like charges line up, and the crystal flies apart along that plane.
Sodium chloride: each Na^+ sits in an octahedral hole surrounded by 6 Cl^-, and each Cl^- likewise by 6 Na^+ (coordination 6, the rock-salt structure). The bond is non-directional, so this dense, symmetric packing is chosen simply to balance the +1 and -1 charges as economically as size allows.
Electron transfer plus non-directional attraction gives dense, size-and-charge-balanced packing.
Pure 100 percent ionic bonding is an idealisation; real ionic bonds always keep some covalent (shared) character, more so when the electronegativity difference is smaller. Calling a bond ionic means it is predominantly, not purely, charge transfer.