If it was wandering, most likely, it was looking for a place to pupate and feeding isn't necessary. If it was on a plant, chances are that this is its host plant. This is one of the biggest clues to identifying it, because most caterpillars have very specific diets, and only eat a few plants. Do your best to identify this plant. Some butterflies lay eggs singly, and others lay them in huge masses.
Many caterpillars are solitary, while others feed in large groups.
To tell someone it's a large, black caterpillar doesn't help. Give an approximate length and diameter. Many caterpillars have 'eyespots' on their heads. Some caterpillars have one horn on their rear-end, some have spines all over their bodies, and some have 'knobs' right behind the head. Describe how your caterpillar looks as accurately as you can.