Recall that computers store numbers in binary. I will assume familiarity with binary and hexadecimal here. On 32-bit systems, each number is stored using 32 bits. Since each hexadecimal digit corresponds to 4 bits, a number stored in a 32-bit CPU register is represented by 8 hexadecimal digits. Such as 0x01a0ff3e.
On the other hand, memory is essentially a large array of bytes, with each byte being 8 bits. So the question arises: how do you take your values, which are 32 bits wide, and store them into memory, where each "slot" is 8 bits?
Naturally, you'd use 4 consecutive bytes to store 1 number. But how should those bytes be ordered? That's the matter of endianness. For example, if you have the number 0x01a0ff3e which needs to be stored into memory, you'd break it up into 4 bytes: 0x01, 0xa0, 0xff, and 0x3e. Let's say you will write these 4 bytes to memory at addresses 0x1000 to 0x1003. You might do so in one of two ways:
memory address | 0x1000 | 0x1001 | 0x1002 | 0x1003 |
value in memory | 0x01 | 0xa0 | 0xff | 0x3e |
0x01a0ff3e in memory, big endian
memory address | 0x1000 | 0x1001 | 0x1002 | 0x1003 |
value in memory | 0x3e | 0xff | 0xa0 | 0x01 |
0x01a0ff3e in memory, little endian
The first option is called "big endian" since the most significant byte, which represents a big numerical value, is stored first. The second option is called "little endian". You may see these abbreviated as BE (big endian) and LE (little endian).
Endianness does not apply if you write a value to memory, and then try to read it. The hardware is aware of the endianness, so loads and stores will both be performed in accordance to the endianness.
Endianness applies if you try and view an int one byte at a time. For example, if you convert an array of integers to an array of bytes, then endianness will determine the ordering of the bytes.
Endianness does not apply to single bytes, since they are the smallest addressable unit of memory. A single byte is always written in the same order that we write binary (or hex) numbers, which is most-significant digit first.
Endianness does not apply for data structures like strings. In C, strings are just an array of bytes, terminated by a null byte. So strings always are always laid out in increasing address order.
Similarly, endianness does not change the ordering of arrays (although if you have an array of ints, endianness will affect how each int is represented)
Endianness applies to not only memory, but also whenever converting an int into bytes, such as:
Most machines nowadays are LE. But when the internet was created, those machines were BE. So the network order today is still BE. Apparently, this is why the x86 ISA has a single instruction to swap the byte order of a register.
Some people argue different advantages and disadvantages of little vs big endian. They say that BE is a more "natural" ordering, since it matches how we write numbers. Or that LE is more efficient, because casting between int* and char* is a no-op, rather than requiring a pointer adjustment. I think it doesn't matter too much, as long as you know which one is being used.