There are several different methods that can be used for this:
Thermal imaging - Recording radiation in the long-infrared range (9,000-14,000nm), ie heat. Most animals are much warmer than their surroundings, so will show up clearly in an image. Disadvantages are thermal cameras can be very expensive, are usually fairly low resolution. Also it may not show much detail of the surroundings, if it is all a similar temperature.
Near-infrared, with a light source - Usually recording in the range of about 700-1000nm, ie just outside the visible range. They have a light source within this range, used as a camera flash (or steady light for video), this is usually a bank of LEDs. This light is outside the visible range for most animals, so they should not be disturbed by it. The range is limited by the power of this light. But if it is too bright, it can make the foreground overexposed. The second video in the question is from a Bushnell trail camera, which uses this method.
Image intensification - Amplifying the limited light that is available, this could include both visible and near-infrared frequencies. This could be from moonlight, or starlight etc. Night-vision goggles are based on this.
For photography, standard digital camera sensors are actually sensitive to near-infrared light. But this would affect regular images, so they include a filter to block infrared, and only pass visible light. For many cameras, it is possible to dismantle it to remove the filter. Or there are several companies offering a conversion service, and selling ready converted cameras. So after conversion, you could take photos in near-infrared. To actually see wildlife at night, you would need a light source, ie LEDs at the right frequency.
Or simpler and cheaper to buy a ready-made trail camera, eg from Bushnell or Ltl Acorn. But this would not have the same resolution or manual controls as an SLR.