If you're in the UK, then you need to know how "ring mains" work.
Each floor of the house will have a separate ring connecting all the sockets together. The wiring is a three core cable, with a Live, Neutral usually coloured red and black, and an uncovered Earth. The wiring starts at one of the fuses in the fuse box and goes to the first socket, connecting all three wires. It then goes to the second socket from the first, also connecting all three wires, and so on round all the sockets on the floor. It then goes back to the fuse box. This means that there are two paths for the current to get from the fuse box to an appliance - either going one way or the other way round the ring.
When you know this, it explains why there are 6 wires in the one of the sockets. One set of 3 will be coming from the previous socket in the ring, and the other set of three will be going to the next socket in the ring. To wire up a new socket, you should have two L and two N connectors on the new socket, plus either one or two earth connectors. Connect the two L wires to the two L connectors on the socket, connect the two N wires to the two N connectors, and connect the Earth wires to the E connectors. You might have to twist the earth wires together if there's only one E connector. Remember to use loose Green/Yellow sleeving on all earth wires to prevent accidental shorts. The golden rule is that you always connect L to L, N to N and E to E. You NEVER cross connect them or you'll create a dangerous short circuit.
So far so good. So why are there 3 of each wire in the other socket. This is probably because of something called a spur socket. You are allowed to run an extra socket off an existing socket in the ring. This is usually for sockets that are added later to the house. You run a 3 core cable from the new socket to the back of an existing ring socket, then connect its wires into the L, N and E connectors.
This is most likely what has happened with your other socket. There is a cable from the previous socket, a cable to the next socket in the ring, and a third cable to a spur socket.
Assuming that your socket has the same 2 L, 2 N and 2 E connectors, then you need to connect 2 L wires into one connector, and the remaining L wire into the other L connector, and similarly for the N and E connections. If possible try to identify which cable goes to the spur, and make sure this is always one of the doubled up connections. The golden rule is you connect the L wires together, the N wires together and the E wires together, and to make sure you always put Green/Yellow sleeving on the E cores. Again, you must NEVER cross connect cables or you'll create a short circuit.
I don't need to tell you how dangerous it can be if you get this wrong - you can start a fire or end up electrocuting yourself. It's particularly dangerous if you swap L and N in a socket, or accidentally fail to connect one of the E wires.
I have a plug in socket safety tester. You plug this in to the socket and if three neons light up then the socket is correctly wired. If only two or one light up then the socket has a wiring fault. I urge you to get one of these before you do any work and then use it to check your work afterwards. You also need to check the other sockets in the house, too, because a fault in one socket can cause the other sockets in the ring to fail.
If you have even the slightest doubt then get an electrician in who will do it safely.