Inheriting vs creating instance within a class

Is there a difference and/or preference between these two?

1.) Inheriting a class

MyNeoPixel.h

#ifndef MyNeoPixel_h
#define MyNeoPixel_h

#include "Adafruit_NeoPixel.h"

class MyNeoPixel {
    public:
        MyNeoPixel();
        Adafruit_NeoPixel strip;
        void begin(int _pin, int _numPixels);
}

#endif

MyNeoPixel.cpp

#include "MyNeoPixel.h"

MyNeoPixel::MyNeoPixel() {
}

void MyNeoPixel::begin(int _pin, int _numPixels) {
    strip = Adafruit_NeoPixel(num_pixels, pin, NEO_GR + NEO_KHZ800) {
    strip.begin();
}

2.) Creating an instance of a class within a class

MyNeoPixel.h

#ifndef MyNeoPixel_h
#define MyNeoPixel_h

#include "Adafruit_NeoPixel.h"

class MyNeoPixel : public Adafruit_NeoPixel {
    public:
        MyNeoPixels(int num_pixels, int pin);
}


#endif

MyNeoPixel.cpp

#include "MyNeoPixel.h"

MyNeoPixel::MyNeoPixel(int num_pixels, int pin) 
:Adafruit_NeoPixel(num_pixels, pin, NEO_GR + NEO_KHZ800) 
{}

void MyNeoPixel::begin() {
    Adafruit_NeoPixel::begin();
}

Those two things are conceptually different. So I don't see how you can compare them.

What are you trying to accomplish? I see no benefit to either approach. Neither code you posted adds or changes any behavior of the Adafruit_NeoPixel class.