Question What part of the psu is this? It is near the wire that connects to the recepticle. It burnt and my pc shut off.

Oh im not planning to fix it. I just wanted to take a peek. It's an unbranded generic psu.
I was almost certain that a capacitor popped since it was the most common thing to happen. But to my surprise the rest of the components look fine and its just that black wire that burnt/tiny black box thingy
 
Does faulty wiring like this brick a pc? I mean the other psu components look unharmed. I guess the only way to know is to buy a replacement.
 
The black box thingy is probably an Class-X capacitor, intended to reduce EMI/EMC.

When a Class-X capacitor, also referred to as an "across the line capacitor"—the capacitor placed between line and neutral—fails because of an over voltage event, it is likely to fail short. This failure, in turn, would cause an over current protective device, like a fuse or circuit breaker, to open. Therefore, a capacitor failing in this fashion would not cause any electrical shock hazards.

ND_x-class_y-class_safety_figure2.jpg

I think the manufacturer "cheaped out" and fitted a sub-standard rectangular capacitor rated at 400V, instead of a more expensive network of high voltage certified capacitors (see below).

No Class-Y rated capacitors are visible on the IEC connector in the photo. This makes it non-compliant with UL and CE safety marking (if any) so it's illegal to sell this PSU in the US or Europe (not that's ever stopped anyone from importing and selling potential death traps).
Vishay_Class_X1-Y2.jpg


safety_cap_with_logo_markings.jpg


If you read reviews of "quality" PSUs in Tomshardware, you'll see a pair of blue Class-Y capacitors soldered across the back of the IEC mains inlet connector (from line to earth and neutral to earth) plus a yellow Class-X capacitor on the main printed circuit board.

The black mark you can see on the board is soot from the vapourised contents of the failed capacitor.

When a wire fails, the insulation usually melts. The black wire looks intact.

https://www.allaboutcircuits.com/technical-articles/safety-capacitor-class-x-and-class-y-capacitors/

CAUTION: The bulk capacitor in an ATX PSU charges up to 340V DC from a 230V AC mains supply and can take some time to discharge after the PSU is switched off. This voltage is well above the 50V SELV limit and can be lethal if touched. That's why there should be a warning label on the PSU case.