Memory consists of electronic components that store instructions, data, and processing results. It comes in two types - primary and secondary memory. Primary memory (RAM) is directly accessible by the CPU and is volatile, while secondary memory (hard disks, USB drives, etc.) provides non-volatile but slower storage. The memory hierarchy balances speed, space, and cost, with primary memory being faster but more expensive and limited than secondary memory.