They're extruded using various recipes.
If you want to make your own, I'd suggest getting a recipe that you're happy with and just roll sausages the diameter you want, and then cut them to length and air dry them.
A lot will depend on what properties you want, but as a general feed pellet (nothing fancy, neither hard nor soft, just a pellet of feed): try ground up dried cat or dog food with maize flour.
I'm working from memory here so your your mileage may vary, 70% dried pet food and 30% maize flour, use one egg to test, add 3-4ml oil and beat together; slowly add the dry mix to the egg until you get a stiffish dough then start kneading it - if you think it's too stiff, dip your hand in water (as in very little water) and knead again.
Wrap mix in cling film and leave in the fridge for a couple of hours.
Take out of fridge and roll into sausages, cut to length and lay them out somewhere warmish and dry (airing cupboard not bathroom
) and shake them regularly. They will take a few days depending on temperature etc..
Don't go mad on oil, there is quite a bit in the dried food, but it will help to bind the mix together, 2 or 3 eggs should be around 5ml, it's not linear.
If you have a stiff plastic cutting board, you can use this to roll the dough.
There are other things that you can add and do, but keep it simple to begin with, and gradually make any changes that you fancy. You may find that you can't stand making them.
If you have a pet cat or dog, and have wet food for them, you can add a bit (about a table spoon per egg) of that into the mix instead of oil.
Different pet foods have different properties, so you will find you'll have to experiment to find what you want. Some recipes need to be rolled a bit thicker than others and vice-versa.
Have fun and keep it simple.