Destroying upon collision

Im new can someone lend a helping me understand this script.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour {
    public Transform explosionPrefab;
    void OnCollisionEnter(Collision collision) {
        ContactPoint contact = collision.contacts[0];
        Quaternion rot = Quaternion.FromToRotation(Vector3.up, contact.normal);
        Vector3 pos = contact.point;
        Instantiate(explosionPrefab, pos, rot) as Transform;

Itrs pretty clear from this code you have no idea how collision works.

Read this:

If you still don’t understand consider doing a tutorial or reading the GOldstone book.