```python
def max_occurrences(nums):
    """
    Finds the item with the maximum occurrences in a given list.
    """
    if not nums:
        return None

    counts = {}
    for item in nums:
        counts[item] = counts.get(item, 0) + 1

    # Find the key (item) with the maximum value (count) in the dictionary.
    # The `key` argument of the max function specifies a function to be
    # called on each item for comparison. Here, we use `counts.get` to
    # compare items based on their counts.
    most_frequent_item = max(counts, key=counts.get)

    return most_frequent_item
```