Structure and union differ in how they allocate memory and access members. Structure allocates memory for all members and allows accessing all members at any time, while union allocates space for the largest member and only allows accessing one member at a time. Both use struct and union keywords respectively to declare them, with struct defining elements and union defining a single element that shares the same memory space.